8000 Rollup causes syntax error by changing valid code to invalid code (import attributes `with` -> `assert`) · Issue #5685 · rollup/rollup · GitHub
[go: up one dir, main page]

Skip to content
Rollup causes syntax error by changing valid code to invalid code (import attributes with -> assert) #5685
@or9

Description

@or9

Rollup Version

4.22.5

Operating System (or Browser)

Google Chrome 128.0.6613.84 (Official Build) (arm64)

Node Version (if applicable)

v20.10.0

Link To Reproduction

repl

Expected Behaviour

Web application should work.

Input:    import mainStyles from "../css/main.css" with { type: "css" };
Output: import mainStyles from "../css/main.css" with { type: "css" };

The expectation is that build tools should build, not change the functionality of code. If it is changing with to assert, then what else is it changing? Given the constantly and rapidly evolving Javascript capabilities and support tables, it seems absurd for a build tool to try to keep up with everything.

image

Actual Behaviour

Web application does not work. (Syntax error thrown)

Input:    import mainStyles from "../css/main.css" with { type: "css" };
Output: import mainStyles from "../css/main.css" assert { type: "css" };

image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0