Why do I keep seeing this "No matching export" error

Started by DaniBZ5 replies3,838 views
DaniBZOriginal post
#1

Hi, I’m new to using npm and don’t understand these errors I’m seeing.

I’m trying to implement the code from this page Transloadit | Uppy and I’ve run:
npm install @uppy/core @uppy/transloadit @uppy/dashboard

When I start my npm server I see many export errors and I’m not sure how to resolve them. Namely they are:
-No matching export in “node-modules-polyfills:fs” for import “ReadStream”
-No matching export in “node-modules-polyfills:crypto” for import “createHash”
-No matching export in “node-modules-polyfills:fs” for import “createReadStream”
-No matching export in “node-modules-polyfills:fs” for import “promises”
-No matching export in “node-modules-polyfills:fs” for import “readFile”

Any advice?

MerlijnTransloadit team
#2

Hi, this seems unrelated to Uppy as we don’t provide polyfills. Can’t you just upgrade your Node version to latest LTS to remove the need for polyfills?

DaniBZ
#3

Thanks for your reply Merlijn. I have tried as you suggested but it seems to be a problem only when I use import Transloadit from '@uppy/transloadit';. I’m trying to use this within a react application, is that the problem? Because this is for node.js only?

MerlijnTransloadit teamReplying to #3
#4

No it also works in the browser. But I can’t help you as this issue is about your build setup and there is no information here for me to help. You’re doing something with node-modules-polyfills?

#5

OK it appears this is an issue in remix with node-modules-polyfills that’s currently being addressed. Thanks for your help.

MerlijnTransloadit team
#6

If you’re using Remix you could try this remix.config.js | Remix as Uppy is ESM-only. Uppy also can’t be server-side rendered so perhaps you may need to do something to make sure it’s only rendered on the client too.