Skip to content

Commit

Permalink
Remove type: "commonjs" to fix importing in NextJS
Browse files Browse the repository at this point in the history
When `"type": "commonjs"` is specified in our package.json, it
apparently causes the following problem in NextJS:

```
Module parse failed: 'import' and 'export' may appear only with 'sourceType: module' (1:0)
> export { default as ControlledBubbleMenu, } from "./ControlledBubbleMenu";
| export { default as LinkBubbleMenu, } from "./LinkBubbleMenu";
| export { default as MenuBar } from "./MenuBar";
```

This is odd, since we indeed *are* using "commonjs" type, as that's the
default, but it seems that fortunately merely omitting this resolves
import errors in NextJS, and still supports NodeJS.

Should resolve #264,
removing one of the changes from
#259, while still
hopefully keeping #256
fixed.
  • Loading branch information
sjdemartini committed Sep 15, 2024
1 parent 666bfc4 commit a4db55e
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"files": [
"dist"
],
"type": "commonjs",
"types": "./dist/cjs/index.d.ts",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
Expand Down

0 comments on commit a4db55e

Please sign in to comment.