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

Remove "type": "module" from all package.json files #1268

Closed
wants to merge 4 commits into from

Conversation

smnandre
Copy link
Collaborator

@smnandre smnandre commented Nov 10, 2023

Since #1264, another person could not build its assets with Encore and a babel plugin.

So for now we decided to revert the "type: module" declaration.

Revert the "type: module"

Remove this "type" line from all package.json files and revert replacing "main:" with "module:"

Before

   "type": "module",
   "module": "dist/foo.js",

After

   "main": "dist/foo.js",

Fix Svelte ESM bug with vite/vitest

We recommend converting your config to ESM by either:

    adding "type": "module" to the nearest package.json
    renaming vite.config.js/vite.config.ts to vite.config.mjs/vite.config.mts

(https://vitejs.dev/guide/troubleshooting.html#config)

So i used the second one.... and it seems to work

```
We recommend converting your config to ESM by either:

    adding "type": "module" to the nearest package.json
    renaming vite.config.js/vite.config.ts to vite.config.mjs/vite.config.mts
```

So i used the second one and it seems to work

https://vitejs.dev/guide/troubleshooting.html#config
@weaverryan
Copy link
Member

Thank you Simon!

@weaverryan
Copy link
Member

PR was merged... just didn't close

@weaverryan weaverryan closed this Nov 11, 2023
weaverryan added a commit that referenced this pull request Nov 11, 2023
This PR was squashed before being merged into the 2.x branch.

Discussion
----------

Remove "type": "module" from all package.json files

Since #1264, another person could not build its assets with Encore and a babel plugin.

So for now we decided to revert the "type: module" declaration.

### Revert the "type: module"

Remove this "type" line from all package.json files and revert replacing "main:" with "module:"

Before
```json
   "type": "module",
   "module": "dist/foo.js",
```

After
```json
   "main": "dist/foo.js",
```

### Fix Svelte ESM bug with vite/vitest

```
We recommend converting your config to ESM by either:

    adding "type": "module" to the nearest package.json
    renaming vite.config.js/vite.config.ts to vite.config.mjs/vite.config.mts
```
(https://vitejs.dev/guide/troubleshooting.html#config)

So i used the second one.... and it seems to work

Commits
-------

919ade7 Remove "type": "module" from all package.json files
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

Successfully merging this pull request may close these issues.

None yet

2 participants