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

Error parsing files using import attributes #2

Closed
zachleat opened this issue May 1, 2024 · 4 comments
Closed

Error parsing files using import attributes #2

zachleat opened this issue May 1, 2024 · 4 comments
Labels
bug Something isn't working
Milestone

Comments

@zachleat
Copy link
Member

zachleat commented May 1, 2024

Notably, this feature is not yet stable in Node.js: https://nodejs.org/docs/latest/api/esm.html#import-attributes

import data from './data.json' with { type: 'json' };

Upstream issue: acornjs/acorn#1289

@what1s1ove said it best: 11ty/eleventy#3128 (comment)

The easiest workaround is to use require in ESM as @uncenter notes here 11ty/eleventy#3128 (comment):

import { createRequire } from "node:module";
const require = createRequire(import.meta.url);
@what1s1ove
Copy link

Hey @zachleat !
I guess now we can resolve it 🙂
acornjs/acorn@3c6a5a9

@captainbrosset
Copy link

This issue has preventing us from testing the web-features-explorer site locally for some time, so I'm very happy to see Acorn get support for import attributes!
Has eleventy been updated to incorporate this upstream fix already?

@zachleat zachleat added the bug Something isn't working label Dec 6, 2024
@zachleat zachleat added this to the v1.0.1 milestone Dec 6, 2024
@zachleat
Copy link
Member Author

zachleat commented Dec 6, 2024

Shipping with v1.0.1 and Eleventy core v3.0.1-alpha.1

@zachleat
Copy link
Member Author

zachleat commented Dec 9, 2024

Core tracking issue at 11ty/eleventy#3580

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