evanw / evanw/esbuild

Could not resolve "path", could not resolve "os"

Open
#3,799 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
40.1k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

When trying to build a react project doing: ` npm run build-dev`
I get a lot of **Could not resolve "path"** **Could not resolve "os"** **Could not resolve "crypto"**

And of course the build fails. I'm building for the browser.

I have to note I'm using this plugin:

`const envFilePlugin = require('esbuild-envfile-plugin');`

![could-not-resolve](https://github.com/evanw/esbuild/assets/22687247/b49a460e-15fb-4808-b3fa-7f0fbd10331a)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the browser build with `npm run build-dev` and the `esbuild-envfile-plugin`, then inspect how the plugin introduces `path`, `os`, and `crypto`. Done means identifying whether the unresolved modules come from esbuild or the plugin and documenting or fixing the browser-build behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js, react
Domain
build-system, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.