Giter Club home page Giter Club logo

Comments (14)

theprivileges avatar theprivileges commented on June 14, 2024 5

I ran into a very similar issue and got around it by:

  • adding @parcel/watcher-linux-x64-glibc into optionalDependencies in package.json
    • npm install -O @parcel/watcher-linux-x64-glibc
  • running npm dedupe
  • 💰

from watcher.

dgadelha avatar dgadelha commented on June 14, 2024 4

Why is a filesystem watcher needed to do an one-shot build of a project?

from watcher.

paceaux avatar paceaux commented on June 14, 2024 3

ran into this same issue. @theprivileges solution worked for me. This was in a github action where I was having the issue.

from watcher.

felixhauptmann avatar felixhauptmann commented on June 14, 2024 2

I just had this issue except with @parcel/watcher-linux-arm-glibc using a Raspberry Pi 4 running Raspberry Pi OS, based on Debian Bullseye. I decided to try using require in the Node REPL to see if it works, and found a more descriptive error: couldn't find glibc 2.32. I checked my system and found I had glibc 2.31 available in the repos. One format to Ubuntu later and I had glibc ~2.37 available and the error is fixed.

Some possibly helpful takeaways from my experience:

  • It seems like the new parcel/watcher distribution system can fail with this Error: No prebuild or local build error and squash a more descriptive error message
  • The new system depends on glibc 2.32, such that some stability-focused distros like Debian can't run it, so check the availability of your repos. Buster is before Bullseye, so you might be hit by the same issue. There may be something similar with musl.
  • You might be able to get a more descriptive error message by using require on the package in question in the REPL or another dummy environment.

Hope this helps you and/or someone else in the future!

I recently ran into a similar issue on a netlify container. We (temporarily) resolved it by manually adding '@parcel/watcher-linux-x64-glibc' as an optional dependency.

from watcher.

estromenko avatar estromenko commented on June 14, 2024 2

Facing the same issue with @parcel/watcher-linux-x64-musl package. Downgrade of parcel or watcher packages did not help

Solved the problem upgrading alpine from 3.15 to 3.18.

To reproduce the issue run commands below (the second one is failing)

docker run --rm -it node:18-alpine3.18 sh -c "yarn add parcel && echo 123 >> index.tsx && yarn parcel build index.tsx"
docker run --rm -it node:18-alpine3.15 sh -c "yarn add parcel && echo 123 >> index.tsx && yarn parcel build index.tsx"

from watcher.

mkhvoiko avatar mkhvoiko commented on June 14, 2024 1

` ERROR #11903 API.TYPESCRIPT.COMPILATION

There was an unhandled error during compilation for /. Please run the command with the --verbose flag again.
No prebuild or local build of @parcel/watcher found. Tried @parcel/watcher-linux-arm64-glibc. Please ensure it is installed (don't use --no-optional when installing with npm).
Otherwise it is possible we don't support your platform yet. If this is the case, please report an issue to https://github.com/parcel-bundler/watcher.

Error: No prebuild or local build of @parcel/watcher found. Tried @parcel/watcher-linux-arm64-glibc. Please ensure it is installed (don't use --no-optional when installing with
npm). Otherwise it is possible we don't support your platform yet. If this is the case, please report an issue to https://github.com/parcel-bundler/watcher.

  • index.js:25 Object.
    /node_modules/@parcel/watcher/index.js:25:13

  • loader:1112 Module._compile
    node:internal/modules/cjs/loader:1112:14

  • loader:1166 Object.Module._extensions..js
    node:internal/modules/cjs/loader:1166:10

  • loader:988 Module.load
    node:internal/modules/cjs/loader:988:32

  • loader:834 Function.Module._load
    node:internal/modules/cjs/loader:834:12

  • loader:1012 Module.require
    node:internal/modules/cjs/loader:1012:19

  • helpers:102 require
    node:internal/modules/cjs/helpers:102:18

  • index.js:7 Object.
    /node_modules/@parcel/fs/lib/index.js:7:28

  • loader:1112 Module._compile
    node:internal/modules/cjs/loader:1112:14

  • loader:1166 Object.Module._extensions..js
    node:internal/modules/cjs/loader:1166:10

  • loader:988 Module.load
    node:internal/modules/cjs/loader:988:32

  • loader:834 Function.Module._load
    node:internal/modules/cjs/loader:834:12

  • loader:1012 Module.require
    node:internal/modules/cjs/loader:1012:19

  • helpers:102 require
    node:internal/modules/cjs/helpers:102:18

  • LMDBCache.js:49 _fs
    /node_modules/@parcel/cache/lib/LMDBCache.js:49:16

  • LMDBCache.js:79 new LMDBCache
    /node_modules/@parcel/cache/lib/LMDBCache.js:79:20

not finished compile gatsby files - 0.101s`

from watcher.

mischnic avatar mischnic commented on June 14, 2024 1

This package also allows detecting changes between one-shot builds: https://github.com/parcel-bundler/watcher#querying

from watcher.

devongovett avatar devongovett commented on June 14, 2024

The package exists https://www.npmjs.com/package/@parcel/watcher-linux-arm64-musl but for some reason (perhaps an npm bug) it may not have been installed properly? Try clearing your package-lock.json and deleting node modules and then re installing. npm/cli#4828

from watcher.

Kureev avatar Kureev commented on June 14, 2024

Can confirm the same thing as the topic starter.

Build log:

 > [builder 5/5] RUN yarn build:
#0 0.501 yarn run v1.22.19
#0 0.553 $ yarn build:sdk && yarn build:hosted
#0 0.798 $ yarn workspace @novoic/storyteller build --log-level=warn
#0 1.365 $ parcel build src/index.tsx --log-level=warn
#0 1.688 Error: No prebuild or local build of @parcel/watcher found. Tried @parcel/watcher-linux-x64-musl. Please ensure it is installed (don't use --no-optional when installing with npm). Otherwise it is possible we don't support your platform yet. If this is the case, please report an issue to https://github.com/parcel-bundler/watcher.
#0 1.688     at Object.<anonymous> (/app/node_modules/@parcel/watcher/index.js:23:13)
#0 1.688     at Module._compile (node:internal/modules/cjs/loader:1159:14)
#0 1.688     at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
#0 1.688     at Module.load (node:internal/modules/cjs/loader:1037:32)
#0 1.688     at Module._load (node:internal/modules/cjs/loader:878:12)
#0 1.688     at Module.require (node:internal/modules/cjs/loader:1061:19)
#0 1.688     at require (node:internal/modules/cjs/helpers:103:18)
#0 1.688     at Object.<anonymous> (/app/node_modules/@parcel/fs/lib/index.js:7:28)
#0 1.688     at Module._compile (node:internal/modules/cjs/loader:1159:14)
#0 1.688     at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
#0 1.815 error Command failed with exit code 1.
#0 1.815 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
#0 1.840 error Command failed.
#0 1.840 Exit code: 1
#0 1.840 Command: /usr/local/bin/node
#0 1.840 Arguments: /opt/yarn-v1.22.19/lib/cli.js build --log-level=warn
#0 1.840 Directory: /app/packages/storyteller
#0 1.840 Output:
#0 1.840
#0 1.841 info Visit https://yarnpkg.com/en/docs/cli/workspace for documentation about this command.
#0 1.867 error Command failed with exit code 1.
#0 1.867 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
#0 1.893 error Command failed with exit code 1.
#0 1.893 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
------
Dockerfile:21
--------------------
  19 |     RUN yarn install
  20 |
  21 | >>> RUN yarn build
  22 |
  23 |     FROM nginx:1.23.0-alpine

Used node:18-alpine3.15 as base image. Would appreciate any solutions. At this point it seems that downgrading is the only option

from watcher.

devongovett avatar devongovett commented on June 14, 2024

Did you follow the instructions in the error message? I can't do anything about npm/yarn not installing things properly. Things to try:

  • Verify that the package actually does not exist in your node_modules
  • Verify that you are not installing with --no-optional (npm) or --ignore-optional (yarn)
  • Check that the missing package is listed in your lock file. If not, delete your lock file and node_modules and re-install.

from watcher.

rogermparent avatar rogermparent commented on June 14, 2024

I just had this issue except with @parcel/watcher-linux-arm-glibc using a Raspberry Pi 4 running Raspberry Pi OS, based on Debian Bullseye.
I decided to try using require in the Node REPL to see if it works, and found a more descriptive error: couldn't find glibc 2.32. I checked my system and found I had glibc 2.31 available in the repos. One format to Ubuntu later and I had glibc ~2.37 available and the error is fixed.

Some possibly helpful takeaways from my experience:

  • It seems like the new parcel/watcher distribution system can fail with this Error: No prebuild or local build error and squash a more descriptive error message
  • The new system depends on glibc 2.32, such that some stability-focused distros like Debian can't run it, so check the availability of your repos. Buster is before Bullseye, so you might be hit by the same issue. There may be something similar with musl.
  • You might be able to get a more descriptive error message by using require on the package in question in the REPL or another dummy environment.

Hope this helps you and/or someone else in the future!

from watcher.

rogermparent avatar rogermparent commented on June 14, 2024

Just popped into the code and I found where the message is logged, and indeed parcel will simply log this message in a catch block regardless of why the require failed.

Maybe right off we could tweak the verbiage of the message to something like Error: Failed to load prebuild, and beyond that maybe pass along messages from the caught error? From there it'll be much easier for users to diagnose whatever their own issue is.

from watcher.

estromenko avatar estromenko commented on June 14, 2024

Facing the same issue with @parcel/watcher-linux-x64-musl package. Downgrade of parcel or watcher packages did not help

from watcher.

shamsup avatar shamsup commented on June 14, 2024

I experienced this issue using the electron-forge typescript-webpack template trying to use @parcel/watcher at runtime.

The error message reported the correct package name, however, inspecting the build output showed webpack was only interpreting the name to require as -glibc instead of appending that to the existing name.

[electron] Error: Cannot find module '-glibc'
[electron]     at webpackMissingModule (/home/shamsup/projects/electron-test/.webpack/main/index.js:27:82)

I am not familiar enough with webpack internals to explain why it misinterprets the require, but this patch resolved the issue (patch-package):

diff --git a/node_modules/@parcel/watcher/index.js b/node_modules/@parcel/watcher/index.js
index 4929c54..64dd688 100644
--- a/node_modules/@parcel/watcher/index.js
+++ b/node_modules/@parcel/watcher/index.js
@@ -4,9 +4,9 @@ let name = `@parcel/watcher-${process.platform}-${process.arch}`;
 if (process.platform === 'linux') {
   const { MUSL, family } = require('detect-libc');
   if (family === MUSL) {
-    name += '-musl';
+    name = `@parcel/watcher-${process.platform}-${process.arch}-musl`;
   } else {
-    name += '-glibc';
+    name = `@parcel/watcher-${process.platform}-${process.arch}-glibc`;
   }
 }

from watcher.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.