Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Bug Report: @novu/framework cannot be used in Cloudflare Pages #6346

Open
2 tasks done
fell-lucas opened this issue Aug 17, 2024 · 6 comments
Open
2 tasks done
Assignees
Labels

Comments

@fell-lucas
Copy link

📜 Description

We get build errors when deploying to CF pages because the package imports unsupported node dependencies.

Even though we are not using the JSON Schema features of @novu/framework, we still get these import errors. Is it possible to ask for conditional importing of the problematic dependencies?

👟 Reproduction steps

  1. Install @novu/framework on a SvelteKit project using @sveltejs/cloudflare-adapter.
  2. Create a workflow using the workflow import from @novu/framework.
  3. Create api/novu/+server.ts and import the serve function from @novu/framework/sveltekit
  4. Run build script / build project

👍 Expected behavior

Not throw build errors because we're not relying on JSON Schema to create our workflows.

👎 Actual Behavior with Screenshots

image

Novu version

Novu SaaS

npm version

NA

node version

NA

📃 Provide any additional context for the Bug.

@novu/framework version: 2.0.0-canary.5

👀 Have you spent some time to check if this bug has been raised before?

  • I checked and didn't find a similar issue

🏢 Have you read the Contributing Guidelines?

Are you willing to submit PR?

Yes I am willing to submit a PR!

Copy link

linear bot commented Aug 17, 2024

@rifont
Copy link
Collaborator

rifont commented Aug 21, 2024

Thanks for reporting this. The required modules shown in your screenshot are not critical runtime dependencies of Framework and we should be able to make those dependencies conditional.

We plan to investigate conditional importing for these dependencies within the next 2 weeks.

@SokratisVidros SokratisVidros self-assigned this Sep 25, 2024
@jkhaui
Copy link

jkhaui commented Oct 22, 2024

Thanks for reporting this. The required modules shown in your screenshot are not critical runtime dependencies of Framework and we should be able to make those dependencies conditional.

We plan to investigate conditional importing for these dependencies within the next 2 weeks.

Hey, just wondering if there's any update?

CF Pages is becoming an increasingly popular deployment platform :)

@SokratisVidros
Copy link
Contributor

We are actively working on a fix for this, aiming to ship it by next week.

@SokratisVidros
Copy link
Contributor

@fell-lucas, can you please try this version "@novu/framework": "https://pkg.pr.new/novuhq/novu/@novu/framework@659f791" on your setup and let us know if the issue is resolved?

@fell-lucas
Copy link
Author

Hey, unfortunately when building with the version you mentioned, I get this new Vite error:

[vite] (ssr) Error when evaluating SSR module /Users/lucasfell/repos/svelte-frontend/src/routes/api/novu/+server.ts:
|- Error [ERR_UNSUPPORTED_DIR_IMPORT]: Directory import '/Users/lucasfell/repos/svelte-frontend/node_modules/.pnpm/@novu+shared@https+++pkg.pr.new+novuhq+novu+@novu+shared@659f791_@[email protected]_class_ut6bzsakpmk2pjcuisivoebxmq/node_modules/@novu/shared/dist/esm/config' is not supported resolving ES modules imported from /Users/lucasfell/repos/svelte-frontend/node_modules/.pnpm/@novu+shared@https+++pkg.pr.new+novuhq+novu+@novu+shared@659f791_@[email protected]_class_ut6bzsakpmk2pjcuisivoebxmq/node_modules/@novu/shared/dist/esm/index.js
    at finalizeResolution (node:internal/modules/esm/resolve:251:11)
    at moduleResolve (node:internal/modules/esm/resolve:913:10)
    at defaultResolve (node:internal/modules/esm/resolve:1037:11)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:650:12)
    at #cachedDefaultResolve (node:internal/modules/esm/loader:599:25)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:582:38)
    at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:241:38)

This error is probably related to this: #7071

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants