Import warning since upgrading Convex
After upgrading from Convex
1.0.3
to 1.3.1
, I'm getting an import error:
I'm using a helper to setup Convex+Clerk and calling it from a NextJS app router page on the server (was previously working fine):
Anything I need to change after upgrading?4 Replies
Hmm.. it seems you are running older version of Node.js, where fetch() is not provided and we try to import node-fetch, but some if its dependencies are not installed (which might mean we have not declared it as dependency).
Sorry about the trouble. As a workaround, can you try either upgrading your node version to Node 18 or npm installing
node-fetch
?
Hmm.. we do declare node-fetch as dependency, so perhaps you need to run npm install
?@holden This looks like an issue with Next.js module resolution and 'encoding' being an optional depenency of node-fetch, like https://github.com/snowflakedb/snowflake-connector-nodejs/issues/609 and some related issues describe. We'll look into this, for now can you try installing `encoding' https://www.npmjs.com/package/encoding and a dev dependency, the workaround suggested in these issues?
GitHub
SNOW-889050: NextJS Weird Warning Message · Issue #609 · snowflaked...
Summary Working with an NX monorepo with NextJS. I'm able to query the database, but grabbing a weird warning message when I launch the application. Figured it might be worth flagging, sorry if...
npm
encoding
Convert encodings, uses iconv-lite. Latest version: 0.1.13, last published: 3 years ago. Start using encoding in your project by running
npm i encoding
. There are 725 other projects in the npm registry using encoding.This should just be a warning message, everything should work fine, so another option is ignoring it.
I'll look at what workaround these other libraries are using to avoid this warning.
ah ok, thanks. yeah, everything seems to be working fine, so maybe just a harmless warning and not specific to convex. i believe i'm using latest node.
i'll just ignore for now, and hope someone fixes upstream of you, thanks!