Giter VIP home page Giter VIP logo

Comments (3)

mxschmitt avatar mxschmitt commented on June 3, 2024 1

I was able to reproduce on Node.js 18 but not on Node.js 20.

Caused by #30482.

Looks like they let V8 parse it rather than transform it.

Also as per here:

Please migrate to @babel/plugin-syntax-import-attributes (#15536). After you replace the plugin, you should search and replace the following patterns in your codebase:

- import value from "module" assert { type: "json" };
+ import value from "module" with { type: "json" };

The test which was added in #30482 seems not getting executed. Doing the following makes it fail:

diff --git a/tests/playwright-test/esm.spec.ts b/tests/playwright-test/esm.spec.ts
index 952cabb09..f26c5c792 100644
--- a/tests/playwright-test/esm.spec.ts
+++ b/tests/playwright-test/esm.spec.ts
@@ -59,11 +59,13 @@ test('should support import attributes', async ({ runInlineTest }) => {
   const result = await runInlineTest({
     'playwright.config.ts': `
       import packageJSON from './package.json' with { type: 'json' };
+      console.log(packageJSON)
       export default { };
     `,
     'package.json': JSON.stringify({ type: 'module' }),
     'a.test.ts': `
       import config from './config.json' with { type: 'json' };
+      console.log(config)
       import { test, expect } from '@playwright/test';
       test('pass', async () => {});
     `

from playwright.

MyrZiKus avatar MyrZiKus commented on June 3, 2024

I couldn't find adequate solutions to this problem

from playwright.

mxschmitt avatar mxschmitt commented on June 3, 2024

Playwright only supports the latest 18.X, 20.X, 22.X releases, we recommend updating e.g. 18.20 or 20.13. Updating to these versions fixes that issue.

from playwright.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.