-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
$78fb23f46eb09f80$exports is not defined #8792
Comments
I'm also running into this. Seems to happen when importing dependencies already built with parcel. I have a monorepo where I created a package Let me know if I can help chase this one down. In the mean time I might change my build system so I can publish my package, otherwise any advice would be much appreciated. |
Thanks, I already have a minimal reproduction for now: // index.js
import { merge } from "../library/a.js";
console.log(merge);
// library/package.json
{ "sideEffects": ["a.js"] }
// library/a.js
export * from './b.js';
// library/b.js
export { merge0 as merge } from "./c.js";
// library/c.js
export function merge0() {return 2;} output: function $5847f4e170f13e39$export$78b9c0f15a94309a() {
return 2;
}
console.log((0, $a33e92888f64d1df$exports.merge)); |
Just an update. I went back up to version 2.8.3. In From: export * from '@rwh/keystrokes'
export { useKey } from './use-key'
export { useKeyCombo } from './use-key-combo' To: export { useKey } from './use-key'
export { useKeyCombo } from './use-key-combo' Best of luck @mischnic, let me know if I can help at all. I love this project :) |
Yes, it's caused by having both a |
Confirm it's caused by |
I have the same when I have a single .jsx file that exports two React components. Parcel bundles this file within two different modules (one is cjs export for SSR and second is esm module for client). ESM bundle seems to work, CSJ has weird outcome: Input:
Output:
When I change the input imports:
Then I get similar error but only setState seems to be missing:
|
@sznowicki Can you open a new issue with a complete reproduction? |
I'll try once I find correct repro. Last time I tried it was always correct. |
I could produce a repro with d3 if you want, as I'm facing the issue from #8849 in my test build. |
Have same issue as @tnarik with D3 and Parcel 2.8.3 version
seems to be missing in the bundle and generates |
I workaround by just doing |
yeah, your workaround with let's check following repo https://github.com/OzzyCzech/d3-parcel-error and try |
For reference, I'm having a similar issue when trying to import the 'yaml' package, because apparently its main |
For anyone having this issue with d3 and you don't want to import the whole 300kb package, simple fix is to use modules separately. F.e. import { select } from "d3-selection"
// instead of
import { select } from "d3" |
Thanks @phfaist your hotfix works - see example error repository "alias": { "d3": "d3/dist/d3.js"} |
I have another scenario: export function aFunc1() {}
export function aFunc2() {}
export function bFunc1() {}
export function bFunc2() {}
import * as a from './lib/a';
import * as b from './lib/b';
(window as any).mylib = Object.assign({}, a, b)
export * from './lib/a';
export * from './lib/b';
import { aFunc1, bFunc1 } from './lib/index';
aFunc1();
bFunc1(); In output it contain export But there isn't |
Is this the same bug where you import something like:
and then use it like so:
However, when it comes to being bundled, the assigned variable for that is undefined. In my case, it's |
We run into this problem after we added chartjs-plugin-datalabels to our project. When serving the result from
parcel build
we get the runtime error:Disabling scope hoisting (
--no-scope-hoist
) makes it work. Parcel 2.7 works, 2.8.0 does not.Removing the following line from package.json in chartjs-plugin-datalabels also makes it work:
not sure if it's relevant.
A minimal example for reproducing the error: https://ommej.se/files/tmp/parcel-6711.tar.gz.
Steps to reproduce:
$ npm install
$ npm run build
$ cd dist
$ python3 -m http.server
(or some other way to serve the files)visit the page in a browser, for example localhost:8000, the console will show the exception
Originally posted by @lanker in #6711 (comment)
The text was updated successfully, but these errors were encountered: