Skip to content

Release a v2 with new exports #7

Closed

Description

@icholy

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

Activity

  1. bompus commented on Aug 29, 2024

    @bompus

    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';

  2. icholy commented on Aug 29, 2024

    @icholy
    Author

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

  3. mobeigi commented on Oct 5, 2024

    @mobeigi

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

  4. lukeed commented on Oct 12, 2024

    @lukeed
    Owner

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

    fixed now -- hexoid@2.0.0 is now available

  5. icholy commented on Oct 12, 2024

    @icholy
    Author

    Thanks!

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions