Skip to content
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

ERROR 'dirname' is not exported by __vite-browser-external #654

Closed
FezVrasta opened this issue Sep 29, 2022 · 1 comment · Fixed by #655
Closed

ERROR 'dirname' is not exported by __vite-browser-external #654

FezVrasta opened this issue Sep 29, 2022 · 1 comment · Fixed by #655
Assignees

Comments

@FezVrasta
Copy link
Collaborator

FezVrasta commented Sep 29, 2022

We are getting this error while trying to update to b36, this happens with Vite 3.0.9

 ERROR  'dirname' is not exported by __vite-browser-external, imported by node_modules/itk-wasm/dist/core/internal/loadEmscriptenModuleNode.js                                18:15:47
file: /Users/federicozivolo/Developer/frontend/node_modules/itk-wasm/dist/core/internal/loadEmscriptenModuleNode.js:4:9
2: // Workaround for EXPORT_ES6
3: // https://github.com/emscripten-core/emscripten/issues/11792
4: import { dirname } from 'path';
            ^
5: import { createRequire } from 'module';
6: globalThis.__dirname = dirname(import.meta.url);

You can observe a similar error on StackBlitz with a minimal Vite example:

https://stackblitz.com/edit/vite-rwqusd?file=package.json,main.js

(open the browser console to see Uncaught TypeError: (0 , import_path.dirname) is not a function)

@thewtex thewtex self-assigned this Sep 29, 2022
thewtex added a commit to thewtex/ITK-Wasm that referenced this issue Sep 29, 2022
Otherwise, this ends up loading './index.js', which brings in Node.js,
which causes issues for Vite / Rollup when bundling for the browser.

Closes InsightSoftwareConsortium#654
github-actions bot pushed a commit that referenced this issue Sep 30, 2022
# [1.0.0-b.37](itk-wasm-v1.0.0-b.36...itk-wasm-v1.0.0-b.37) (2022-09-30)

### Bug Fixes

* **itkConfig.ts:** Import from './browser/index.js' ([f6a125d](f6a125d)), closes [#654](#654)
@github-actions
Copy link

🎉 This issue has been resolved in version 1.0.0-b.37 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants