#Err: Consider disabling ssr.noExternal or remove the built-in dependency

5 messages · Page 1 of 1 (latest)

nimble glacier
#

Edit: solved with new strategy

I need to talk to an external server and Im using JWT to do so. Everything seems to work well in dev, but I'm getting this error from the jsonwebtoken package when trying to build my qwik-city app.

✓ 25 modules transformed.
x Build failed in 424ms
error during build:
[commonjs--resolver] [plugin vite:resolve] Cannot bundle Node.js built-in "crypto" imported from "node_modules/jsonwebtoken/sign.js". Consider disabling ssr.noExternal or remove the built-in dependency.
file: /Users/geekcentric/Code/log_interpreter/log_interpreter_fe/node_modules/jsonwebtoken/index.js

Does this indicate I'm not doing things securely / as recommended? Im using the jsonwebtoken package in a server$ and routeAction$ function -- which I thought was server side.

hidden rampart
nimble glacier
#

I ended up changing tactics and using the providers oauth token to generate a token of my own from an external server -- so I was able to uninstall the package causing the problem.

If I ever wanted to roll my own auth purely using qwik-city (no external api) that would be an issue 🤔 I was generating jwt in a routeAction$ and a server$ function.

river pewter
#

@nimble glacier could it be the node version?

nimble glacier