#1977·standard

Parsing error when using import attributes

Author: travispaulCreated Nov 15, 2024Updated Jun 29, 2026

Here's what I did

standard test.js

and test.js has the following contents:

javascript
import pkg from '../package.json' with { type: 'json' }
console.log(pkg)

What I expected to happen

No parsing error to be reported when using an import attribute

What seems to have happened

A parsing error is emitted:

$ standard test.js
standard: Use JavaScript Standard Style (https://standardjs.com)
  X:\src\misc\main\card\test.js:1:35: Parsing error: Unexpected token with (null)

Using Node.js v22.11.0 with Standard 17.1.2