Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ERROR] Could not resolve (... some temp file) #6

Open
nertzy opened this issue Dec 23, 2021 · 4 comments
Open

[ERROR] Could not resolve (... some temp file) #6

nertzy opened this issue Dec 23, 2021 · 4 comments

Comments

@nertzy
Copy link

nertzy commented Dec 23, 2021

I am sporadically getting these messages when I try to chain esbuild-plugin-sass followed by esbuild-plugin-css-modules.

The error is not happening consistently, so I assume it's some sort of race condition.

❯ ./build.js
✘ [ERROR] Could not resolve "/var/folders/tg/vwvky4sd66vgvjkl0njrkl000000gn/T/tmp-87375-BNfLN4lwtij1/scrapbook-browser/lib/style/login.css"

    ../../../../../../var/folders/tg/vwvky4sd66vgvjkl0njrkl000000gn/T/tmp-87375-BNfLN4lwtij1/scrapbook-browser/lib/style/login.module.css:2:15:
      2 │         import "/var/folders/tg/vwvky4sd66vgvjkl0njrkl000000gn/T/tmp-87375-BNfLN4lwtij1/scrapbook-browser/lib/style/login.css";
        ╵                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

✘ [ERROR] Could not resolve "/var/folders/tg/vwvky4sd66vgvjkl0njrkl000000gn/T/tmp-87375-bqafdvagfR2x/scrapbook-browser/lib/style/login.css"

    ../../../../../../var/folders/tg/vwvky4sd66vgvjkl0njrkl000000gn/T/tmp-87375-bqafdvagfR2x/scrapbook-browser/lib/style/login.module.css:2:15:
      2 │         import "/var/folders/tg/vwvky4sd66vgvjkl0njrkl000000gn/T/tmp-87375-bqafdvagfR2x/scrapbook-browser/lib/style/login.css";
        ╵                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@nertzy
Copy link
Author

nertzy commented Dec 25, 2021

Here's a reproduction of sorts https://github.com/nertzy/esbuild-plugin-css-modules-tempfile-bug

It gives me a different error:

~/code/esbuild-plugin-css-modules-tempfile-bug main
❯ npm run build

> esbuild-plugin-css-modules-tempfile-bug@1.0.0 build
> node build.js

✘ [ERROR] [plugin css-modules] EACCES: permission denied, mkdir '/var/folders/var'

    index.js:1:18:
      1 │ import style from './style.module.scss';
        ╵                   ~~~~~~~~~~~~~~~~~~~~~

  This error came from the "onLoad" callback registered here:

    node_modules/esbuild-plugin-css-modules/lib/index.js:60:18:
      60 │             build.onLoad({ filter: filter }, function (args) { return __awaiter(_this, void 0, void 0, function () {
         ╵                   ~~~~~~

    at setup (/Users/grant/code/esbuild-plugin-css-modules-tempfile-bug/node_modules/esbuild-plugin-css-modules/lib/index.js:60:19)
    at handlePlugins (/Users/grant/code/esbuild-plugin-css-modules-tempfile-bug/node_modules/esbuild/lib/main.js:807:23)
    at Object.buildOrServe (/Users/grant/code/esbuild-plugin-css-modules-tempfile-bug/node_modules/esbuild/lib/main.js:1101:7)
    at /Users/grant/code/esbuild-plugin-css-modules-tempfile-bug/node_modules/esbuild/lib/main.js:1954:17
    at new Promise (<anonymous>)
    at Object.build (/Users/grant/code/esbuild-plugin-css-modules-tempfile-bug/node_modules/esbuild/lib/main.js:1953:14)
    at Object.build (/Users/grant/code/esbuild-plugin-css-modules-tempfile-bug/node_modules/esbuild/lib/main.js:1807:51)
    at Object.<anonymous> (/Users/grant/code/esbuild-plugin-css-modules-tempfile-bug/build.js:7:9)
    at Module._compile (node:internal/modules/cjs/loader:1097:14)

Build failed with 1 error:
index.js:1:18: ERROR: [plugin: css-modules] EACCES: permission denied, mkdir '/var/folders/var'

@naltatis
Copy link

naltatis commented Jun 4, 2024

Same problem here. Noticed that this only happens in watch-mode. One time build runs without errors.

✘ [ERROR] Could not resolve "/var/folders/09/6h9fyj312rl6lkm877x0pzp00000gn/T/tmp-15303-qj3BGUuSrhGB/Users/bob/project/src/components/Header.css"

    src/components/Header.module.css:2:15:
      2 │         import "/var/folders/09/6h9fyj312rl6lkm877x0pzp00000gn/T/tmp-15303-qj3BGUuSrhGB/Users/bob/project/src/components/...
        ╵                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

1 error
initial build failed Error: Build failed with 1 error:
src/components/Header.module.css:2:15: ERROR: Could not resolve "/var/folders/09/6h9fyj312rl6lkm877x0pzp00000gn/T/tmp-15303-qj3BGUuSrhGB/Users/bob/project/src/components/Header.css"
    at failureErrorWithLog (/Users/bob/project/node_modules/esbuild/lib/main.js:1472:15)
    at /Users/bob/project/node_modules/esbuild/lib/main.js:945:25
    at runOnEndCallbacks (/Users/bob/project/node_modules/esbuild/lib/main.js:1315:45)
    at buildResponseToResult (/Users/bob/project/node_modules/esbuild/lib/main.js:943:7)
    at /Users/bob/project/node_modules/esbuild/lib/main.js:970:16
    at responseCallbacks.<computed> (/Users/bob/project/node_modules/esbuild/lib/main.js:622:9)
    at handleIncomingPacket (/Users/bob/project/node_modules/esbuild/lib/main.js:677:12)
    at Socket.readFromStdout (/Users/bob/project/node_modules/esbuild/lib/main.js:600:7)
    at Socket.emit (node:events:519:28)
    at addChunk (node:internal/streams/readable:559:12) {
  errors: [Getter/Setter],
  warnings: [Getter/Setter]

@naltatis
Copy link

naltatis commented Jun 4, 2024

BTW: The files from the errors do exist hand have plausible content. Really looks like a race condition error.

@naltatis
Copy link

naltatis commented Jun 6, 2024

I've debugged this issue a little further. Problem seems to appear when running two watch-instances - in my case client & server-build. Both are working in the same temp dir which leads to this error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants