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

use of experimental node features causes warnings #342

Closed
aspiers opened this issue Dec 30, 2023 · 1 comment · Fixed by #344
Closed

use of experimental node features causes warnings #342

aspiers opened this issue Dec 30, 2023 · 1 comment · Fixed by #344
Assignees
Labels
bug Something isn't working

Comments

@aspiers
Copy link
Contributor

aspiers commented Dec 30, 2023

Describe the bug

If I run pnpm dev on a fresh install, I see these two warnings:

(node:22422) ExperimentalWarning: Import assertions are not a stable feature of the JavaScript language. Avoid relying on their current behavior and syntax as those might change in a future version of Node.js.
(Use `node --trace-warnings ...` to show where the warning was created)
 Manifest file copy complete: /home/adam/git/chrome-extension-boilerplate-react-vite/dist/manifest.json
built in 1260ms.
(node:22422) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time

I believe these are caused by the following import:

import packageJson from './package.json' assert { type: 'json' };

To Reproduce
Steps to reproduce the behavior:

  1. git clone https://github.com/Jonghakseo/chrome-extension-boilerplate-react-vite.git
  2. cd chrome-extension-boilerplate-react-vite
  3. pnpm i
  4. pnpm dev

Expected behavior
It should start up with a clean output with no warnings.

@aspiers aspiers added the bug Something isn't working label Dec 30, 2023
@aspiers
Copy link
Contributor Author

aspiers commented Dec 30, 2023

I see that node recently gained a --disable-warning option, so this might be a good solution, although ideally we could just avoid using experimental features altogether. Is there another way to get manifest.js to read package.json at compile time?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants