-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Named export 'blue' not found #343
Comments
I had the same issue. Check out this commit lIlIIlIlIII@5233ef7 |
Ack! I thought I fixed this already, but I changed it back in 0d62bf4. Seems to be an issue with how Bun handles CJS vs ESM, which is odd because it worked fine for me for a long time (it's one of the pain points that caused us to switch from Node to Bun). I'll make a PR to revert it in a sec (sorry if this causes a merge conflict with your work @lIlIIlIlIII, I'll deal with it) |
Hold on a second, this means the script is being run with Node instead of Bun (which Bun does by default for... reasons). Try @lIlIIlIlIII's commit lIlIIlIlIII@5233ef7 also seems to solve this by adding |
The commit I linked is from a branch where I was experimenting with i18n support. I probably won't create a PR for that branch since the implementation isn't great, so it should be fine. |
Looks like awesome work though! I've created #347 and added some more comments to track this. |
These are some of the things what made me dislike the implementation:
|
Describe the bug
I can't sucsessfully run
bun run build
without getting an errorReproduction
run
bun run build
Expected behaviour
The server builds and I can use
bun preview
Logs
node:internal/event_target:1100
process.nextTick(() => { throw err; });
^
file:///C:/Users/Name/MercuryCore/Site/.svelte-kit/output/server/chunks/surreal.js:2
import { blue, green, magenta, red } from "picocolors";
^^^^
SyntaxError: Named export 'blue' not found. The requested module 'picocolors' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:
import pkg from 'picocolors';
const { blue, green, magenta, red } = pkg;
Emitted 'error' event on Worker instance at:
at [kOnErrorMessage] (node:internal/worker:326:10)
at [kOnMessage] (node:internal/worker:337:37)
at MessagePort. (node:internal/worker:232:57)
at [nodejs.internal.kHybridDispatch] (node:internal/event_target:826:20)
at MessagePort. (node:internal/per_context/messageport:23:28)
Node.js v20.12.2
error: script "build" exited with code 1
System info
Bun 1.1.27, Docker 27.1.1
The text was updated successfully, but these errors were encountered: