issues in reexport #1055
Closed
IWANABETHATGUY
started this conversation in
General
Replies: 1 comment
-
Explicit named export has higher priority 1.// main.js
import { a } from './foo'
console.log(a)
// foo.js
export const a = 'foo';
export * from './bar'
// bar.js
export const a = 'bar'Expected// foo.js
export const a = 'foo';
// main.js
console.log(a)Explicit named export has higher priority 2.// main.js
import { a } from './foo'
console.log(a)
// foo.js
export { a } from './baz'
export * from './bar'
// bar.js
export const a = 'bar'
// baz.js
export const a = 'baz'Expected// foo.js
export const a = 'baz';
// main.js
console.log(a)Conflicted name by re-export all should be hidden// main.js
export * from './foo'
export * from './bar'
// foo.js
export const a = 'foo'
export const b = 'foo'
// bar.js
export const a = 'bar'Expected// foo.js
export const b = 'foo'; |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
reexport have duplicate
File: example/index.mjs
File: example/bar.mjs
File: example/foo.mjs
File: example/result.mjs
Summary
foo.mjsandresult.mjshave exportedbexecute
node index.mjsgot:
import { b } from './bar.mjs' ^ SyntaxError: The requested module './bar.mjs' contains conflicting star exports for name 'b' at ModuleJob._instantiate (node:internal/modules/esm/module_job:123:21) at async ModuleJob.run (node:internal/modules/esm/module_job:189:5) at async Promise.all (index 0) at async ESMLoader.import (node:internal/modules/esm/loader:526:24) at async loadESM (node:internal/process/esm_loader:91:5) at async handleMainPromise (node:internal/modules/run_main:65:12)only edit
bar.mjsNow both
bar.mjs,foo.mjsandresult.mjshave exportedbexecute it again
got nothing in output
Beta Was this translation helpful? Give feedback.
All reactions