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.

[Bug]: Could not resolve `"./client"`, `"./server"`, `"./platform"`

See original GitHub issue

Which Remix packages are impacted?

  • remix (Remix core)
  • create-remix
  • @remix-run/architect
  • @remix-run/cloudflare-workers
  • @remix-run/dev
  • @remix-run/express
  • @remix-run/netlify
  • @remix-run/node
  • @remix-run/react
  • @remix-run/serve
  • @remix-run/server-runtime
  • @remix-run/vercel

What version of Remix are you using?

1.0.4

Steps to Reproduce

Just following the very first chapter of the tutorial:

npx create-remix@latest [./my-remix-app, Remix App Server, TypeScript, Yes]
cd my-remix-app
npm run dev
Output:
~/Projects/my-remix-app via ⬢ v16.13.0
➜ npm run dev

> dev
> remix dev

Watching Remix app in development mode...

 > node_modules/remix/browser/index.js:11:14: error: Could not resolve "./client"
    11 │ export * from './client';
       ╵               ~~~~~~~~~~

  > node_modules/remix/browser/index.js:12:14: error: Could not resolve "./server"
    12 │ export * from './server';
       ╵               ~~~~~~~~~~

  > node_modules/remix/browser/index.js:13:14: error: Could not resolve "./platform"
    13 │ export * from './platform';
       ╵               ~~~~~~~~~~~~


Build failed with 3 errors:
node_modules/remix/browser/index.js:11:14: error: Could not resolve "./client"
node_modules/remix/browser/index.js:12:14: error: Could not resolve "./server"
node_modules/remix/browser/index.js:13:14: error: Could not resolve "./platform"
💿 Built in 366ms
Environment details:
~/Projects/my-remix-app via ⬢ v16.13.0 took 2m 53s
➜ npm -v
8.1.4

~/Projects/my-remix-app via ⬢ v16.13.0
➜ node -v
v16.13.0

~/Projects/my-remix-app via ⬢ v16.13.0
➜ sw_vers
ProductName:	macOS
ProductVersion:	12.0.1
BuildVersion:	21A559

Expected Behavior

The app would start properly and become available under http://localhost:3000 as per tutorial guidelines

Actual Behavior

The app does not start due to build failing on module resolution

Issue Analytics

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

github_iconTop GitHub Comments

4reactions
girishk21commented, Nov 23, 2021

to initialise the remix package, Remix has to be initialised by running a postinstall script. You can add the script to package.json as

"postinstall": "remix setup <adapter>"
2reactions
EtienneGrallcommented, Nov 23, 2021

npm should automatically run the postinstall script after npm install. You probably set ignore-scripts to true in your local npm config. Running the script manually should make it work

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot issues with WSUS client agents - Microsoft Learn
This article helps you diagnose and resolve issues with the Windows Server Update Services (WSUS) client agents.
Read more >
In certain circumstances, goal can be gone before client gets ...
Based on my thought, action server provide goal cache mechanism can resolve this problem. Of cause, there is no implementation which action can ......
Read more >
Bug(?): Can't connect to server - Ubiquiti Community
I recently installed AC2 on a server.My college can reach the server remote from his computer, but I can't do it. The only...
Read more >
History of Client for Open Enterprise Server 2 ( Novell Client 2 ...
Possible memory corruption if the NCP Encryption initialization failed unexpectedly. (Bug 1173526) 2. Unlock workstation may require ...
Read more >
1999321 – DNS often stops resolving properly after FreeIPA ...
So it seems the issue affects requests that need to be forwarded, but not ones the name server can resolve itself. I also...
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