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.

Cannot find module '../lib/load-env-config'.

See original GitHub issue

I use a similar structure of this example, during compilation of functions:

tsc --project src/functions

I got this error:

node_modules/next/types/index.d.ts:8:21 - error TS2307: Cannot find module '../lib/load-env-config'.

System information

  • OS: (K)Ubuntu 19.10
  • Version of Node: 10.19.0
  • Version of Next.js: 9.3.2

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
comxdcommented, Mar 27, 2020

Fixing the path in node_modules/next/types/index.d.ts working good: import { Env } from '../dist/lib/load-env-config';

I can provide more details later.

0reactions
balazsorban44commented, Jan 30, 2022

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

System information - GitHub
I got this error: node_modules/next/types/index.d.ts:8:21 - error TS2307: Cannot find module '../lib/load-env-config'.
Read more >
How to load environment variable in tests with Next.js?
During your tests you can leverage loadEnvConfig from @next/env to make sure your environment variables are loaded the same way Next.js does ...
Read more >
module build failed (from ./node_modules/eslint-loader/dist/cjs.js ...
I'm getting this error when trying to use in my Vue3 project. Anybody encountered this before? TypeError: Cannot read properties of undefined (reading...
Read more >
next-sanity - npm
Pros: Checks if the user is authenticated for you. Pairs well with Sanity Studio preview panes. Cons: Doesn't implement ...
Read more >
next-server.ts - vercel/next.js - Sourcegraph
`Could not find a production build in the '${this.distDir}' directory. Try building your app with 'next build' before starting the production server.
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