question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

wrong `globals.d.ts` path in `remix.env.d.ts` @remix-run/node 1.6.2

See original GitHub issue

What version of Remix are you using?

1.6.2

Steps to Reproduce

  1. Run npx create-remix@latest.
  2. Select Just the basics / Vercel / TypeScript.
  3. Install dependencies. (npm or yarn)
  4. see remix.env.d.ts file.

Expected Behavior

/// <reference types="@remix-run/dev" />
/// <reference types="@remix-run/node/globals" />

no error in this remix.env.d.ts.

Actual Behavior

but not found "@remix-run/node/globals"

image

To avoid the error, I tried to something:

1. change path @remix-run/node/globals -> @remix-run/node/dists/globals

/// <reference types="@remix-run/dev" />
/// <reference types="@remix-run/node/dists/globals" />

2. or typesVersions in package.json

// @remix-run/node/package.json
{
  // ...
  "typesVersions": {
    "*": {
      "globals": ["./dist/globals.d.ts"]
    }
  },
  // ...
}

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
brophdawg11commented, Jul 8, 2022

@david-crespo installGlobals is re-exported at the root do I don’t think you should need the deep import. Does import { installGlobals } from '@remix-run/node work for you?

2reactions
brophdawg11commented, Jun 29, 2022

Closing this out as this should be fixed in 1.6.3 - please re-open if you still run into issues!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Environment Variables - Remix
Running remix build compiles using the value of process.env.NODE_ENV if it corresponds with a valid mode: "production", "development" or "test". If the value...
Read more >
ts-node ignores d.ts files while tsc successfully compiles the ...
I've found that /// <reference path="./types/global.d.ts" /> does the trick but I'd have to repeat it in every file using global.app . My ......
Read more >
nx jest unexpected token 'export' - You.com | The AI Search ...
When I run jest, on some test it will throw an error about failure to import .js files with export in them. Strange...
Read more >
Remix integration sets up the wrong port by default - Fly.io
On an app created and launched with create-remix latest and flyctl latest I don't have a .env file, and remix.env.d.ts is empty other...
Read more >
TypeScript errors and how to fix them
error TS1046: Top-level declarations in .d.ts files must start with either a 'declare' or 'export' modifier. Broken Code ❌. index.d ...
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