TypeScript issue for `import.meta`
See original GitHub issueWe’re currently tracking a bug in @types/snowpack-env that is causing “object is undefined” errors. We’re working on getting a fix into the types package today.
More info: https://github.com/snowpackjs/snowpack/discussions/1533
short term fix: @types/snowpack-env@2.3.1 is bad, so pin to @types/snowpack-env@2.3.0 exactly.
Issue Analytics
- State:
- Created 3 years ago
- Comments:13 (13 by maintainers)
Top Results From Across the Web
`import.meta.url` error in .mts files · Issue #49842
error TS1470: The 'import.meta' meta-property is not allowed in files which will build into CommonJS output.
Read more >Typescript Types for import.meta.env - vue.js
I had similar problems and solved it by. tsconfig.json. { ... "compilerOptions": { ... "target": "ESNext", "types": ["vite/client"] } }.
Read more >Vite — Resolve `import.meta.glob` in TypeScript - Future Studio
Read on to resolve Vite's types and tell TypeScript about the provided import. meta utilities.
Read more >import.meta - JavaScript - MDN Web Docs
The import.meta meta-property exposes context-specific metadata to a JavaScript module. It contains information about the module, ...
Read more >tsc-esm-fix
Problem · TS/13422 / TS/16577: tsc should add .js extensions for relative module paths if compiled as es2020/esnext . · ts-jest/1174: import.meta ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
We got it through the DT auto-merge workflow instead! Merged and ready to go out in the next @types release. When that happens (@stramel has seen 30min-1hr) all new templates should be fixed and all existing can do a fresh npm/yarn install of the latest @types package to fix.
Apologies again for the delay getting this out to you all, DefinitelyTyped has limited support for ImportMeta so we had to fight (or more accurately, fiddle) a bit with the PR workflow to get it merged. The good news is that going forward:
sorry - 5 days late, but pinging me was a good call ( I would have recommended setting it up how you did, I just get a lot of pings and some fall through the crack ) - funny, if I had got a bit further on my work on Snowpack HMR with Phaser, I’d probably have hit this too.