TypeScript issue for `import.meta`

See original GitHub issue

We’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:closed
  • Created 3 years ago
  • Comments:13 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
FredKSchottcommented, Nov 10, 2020

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:

  • we now know how to do this much faster next time
  • we now know that given this friction, we need to test any DT changes ourselves before merging
0reactions
ortacommented, Nov 16, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found