wmalarski / qwik-authjs-example

Next-Auth.js + Qwik example integration
MIT License
27 stars 5 forks source link

Cloudflare Pages support #6

Open bbigras opened 1 year ago

bbigras commented 1 year ago

Any idea if your authjs example could work with Cloudflare Pages? The qwik community desperately need an example code that would run with express (like yours) and one for cloudflare and other (webcrypto or whatever).

[commonjs--resolver] Cannot bundle Node.js built-in "crypto" imported from "src/lib/index.ts". Consider disabling ssr.noExternal or remove the built-in dependency.
error during build:
RollupError: Cannot bundle Node.js built-in "crypto" imported from "src/lib/index.ts". Consider disabling ssr.noExternal or remove the built-in dependency.
    at error (file:///home/bbigras/src/qwik-next-auth-example/node_modules/.pnpm/rollup@3.10.1/node_modules/rollup/dist/es/shared/rollup.js:2041:30)
    at Object.error (file:///home/bbigras/src/qwik-next-auth-example/node_modules/.pnpm/rollup@3.10.1/node_modules/rollup/dist/es/shared/rollup.js:23502:20)
    at Object.resolveId (file:///home/bbigras/src/qwik-next-auth-example/node_modules/.pnpm/vite@4.0.4_@types+node@18.11.18/node_modules/vite/dist/node/chunks/dep-5e7f419b.js:21349:34)
    at Object.handler (file:///home/bbigras/src/qwik-next-auth-example/node_modules/.pnpm/vite@4.0.4_@types+node@18.11.18/node_modules/vite/dist/node/chunks/dep-5e7f419b.js:44716:19)
    at file:///home/bbigras/src/qwik-next-auth-example/node_modules/.pnpm/rollup@3.10.1/node_modules/rollup/dist/es/shared/rollup.js:23704:40
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async PluginDriver.hookFirstAndGetPlugin (file:///home/bbigras/src/qwik-next-auth-example/node_modules/.pnpm/rollup@3.10.1/node_modules/rollup/dist/es/shared/rollup.js:23604:28)
    at async resolveId (file:///home/bbigras/src/qwik-next-auth-example/node_modules/.pnpm/rollup@3.10.1/node_modules/rollup/dist/es/shared/rollup.js:22547:26)
    at async ModuleLoader.resolveId (file:///home/bbigras/src/qwik-next-auth-example/node_modules/.pnpm/rollup@3.10.1/node_modules/rollup/dist/es/shared/rollup.js:22811:15)
    at async Object.resolveId (file:///home/bbigras/src/qwik-next-auth-example/node_modules/.pnpm/vite@4.0.4_@types+node@18.11.18/node_modules/vite/dist/node/chunks/dep-5e7f419b.js:8001:10)

 ELIFECYCLE  Command failed with exit code 1.
wmalarski commented 1 year ago

Sure. But I never worked with cloudflare before. I think this could be a good reason for me to eventually move in that direction. I will do some research.

bbigras commented 1 year ago

I'm wondering if using a polyfill like https://github.com/PeculiarVentures/webcrypto-liner would be fine. It's weird that there's only 133 github stars.