Closed talentlessguy closed 3 years ago
I see, I don't see why the test on build 14.x is failing. It works fine locally.
Can you change in the main.yml file the matrix to: node-version: [12.x, 14.x, 16.x]
? so we can trigger a re-run
also, I would consider this as fix
not a feat
🙏
@aboutlo oops sorry, will change commit message
lol tests fail on node v14 for no reason...
I think it a kind of race condition. The events part is a bit fragile and I should rework it... but I have no bandwidth currently :/
Ok, green but for sure something is off there
@aboutlo yay thanks! weird tbh that it randomly failed before but it's green now anyways so... it works
Looks like "type": "module"
is required for the package to work with ESM
or for files to have .mjs extension
see: https://github.com/vercel/next.js/issues/23725#issuecomment-886988737
I fear this need to rethink how the build is done. Perhaps changing the template to something that supports module
correctly.
Hello again, I'm in process of writing next-eth, an Ethereum library for Next.js
It's a well-known problem that Next.js doesn't play with ESM well, but in recent version it got fixed. You can try it out with Next.js 11.0.2-canary.14 and use this config:
So there's a problem. My library depends on ether-swr. Next.js treats it as a CommonJS module because it has no "exports" field in package.json. And this results in this error:
the solution is to make this package mixed - e.g. have an
"exports"
declaration that points to CJS and ESM versions. Note that it will still work the same for old and new versions of Next.jsFor more information, see this: