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

Release a v2 with new exports #7

Closed
icholy opened this issue Jul 30, 2024 · 5 comments
Closed

Release a v2 with new exports #7

icholy opened this issue Jul 30, 2024 · 5 comments

Comments

@icholy
Copy link

icholy commented Jul 30, 2024

The v1.0.0 release causes issues with webpack because the commonjs & ESM modules don't export the same API.

I noticed that this has been fixed in master, but hasn't been published. Can this happen?

edit: Here's a minimal repro of the problem:

main.js

const hexoid = require('hexoid');

hexoid(25);

webpack.config.js

module.exports = {
	target: 'node',
	entry: './main.js',
	optimization: {
		minimize: false
	}
}

Steps:

webpack
node dist/main.js

Output:

/home/icholy/src/playground/hexoid-webpack/dist/main.js:90
hexoid(25);
                ^

TypeError: hexoid is not a function
    at /home/icholy/src/playground/hexoid-webpack/dist/main.js:90:17
    at Object.<anonymous> (/home/icholy/src/playground/hexoid-webpack/dist/main.js:92:12)
    at Module._compile (node:internal/modules/cjs/loader:1376:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
    at Module.load (node:internal/modules/cjs/loader:1207:32)
    at Module._load (node:internal/modules/cjs/loader:1023:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)
    at node:internal/main/run_main_module:28:49
@bompus
Copy link

bompus commented Aug 29, 2024

Master does seem to work properly. For now, I am using ES and import hexoid from 'hexoid';, but I believe on master, it would be a breaking semver major change to import { hexoid } from 'hexoid';

@icholy
Copy link
Author

icholy commented Aug 29, 2024

@bompus yep, that's why it needs to be a v2 release.

@mobeigi
Copy link

mobeigi commented Oct 5, 2024

@lukeed Any chance we can get this resolved? Would be much appreciated.

@lukeed
Copy link
Owner

lukeed commented Oct 12, 2024

sorry, not sure how/why the branch was left unsync'd

fixed now -- [email protected] is now available

@lukeed lukeed closed this as completed Oct 12, 2024
@icholy
Copy link
Author

icholy commented Oct 12, 2024

Thanks!

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

No branches or pull requests

4 participants