Skip to content

@rollup/plugin-typescript throw error #1806

@sacru2red

Description

@sacru2red
  • Rollup Plugin Name: @rollup/plugin-typescript
  • Rollup Plugin Version: 12.1.1
  • Rollup Version: 4.22.0
  • Operating System (or Browser): Windows
  • Node Version: 22.11.0
  • Link to reproduction (⚠️ read below):

Expected Behavior

No Errors

Actual Behavior

(I am trying with ' --importAttributesKey with' too)

> rollup -c rollup.config.ts --configPlugin @rollup/plugin-typescript

[!] SyntaxError: Unexpected identifier 'assert'
    at compileSourceTextModule (node:internal/modules/esm/utils:340:16)
    at ModuleLoader.moduleStrategy (node:internal/modules/esm/translators:102:18)
    at ModuleLoader.#translate (node:internal/modules/esm/loader:433:12)
    at ModuleLoader.loadAndTranslate (node:internal/modules/esm/loader:480:27)
    at ModuleJob._link (node:internal/modules/esm/module_job:112:19)

same config js file works

> rollup -c rollup.config.js

Additional Information

node v20 -> works, v22 -> errors
import pkg from './package.json' with { type: 'json' }

rollup/rollup#5685

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions