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.

[Parcel 2] Auto Installing failed all the time

See original GitHub issue

🎛 Configuration

.parcelrc

{
    "extends": "@parcel/config-default",
    "transformers": {
        "*.{ts,tsx}": [
            "@parcel/transformer-typescript-tsc"
        ],
        "*.{png}": [
            "@parcel/transformer-raw"
        ]
    }
}

tsconfig.json

{
    "compilerOptions": {
        "target": "ES5",
        "module": "ES2020",
        "moduleResolution": "Node",
        "allowSyntheticDefaultImports": true,
        "experimentalDecorators": true,
        "jsx": "react",
        "lib": ["ES2020", "DOM"],
        "sourceMap": true,
        "outDir": "./dist/"
    },
    "include": ["src/**/*"]
}

🤔 Expected Behavior

no error

😯 Current Behavior

Server running at http://localhost:1234 🚨 Build failed.

Error: Failed to install @parcel/transformer-webmanifest: process.chdir() is not supported in workers

at install (\node_modules@parcel\package-manager\lib\installPackage.js:131:11)
at async PromiseQueue._runFn (\node_modules@parcel\package-manager\node_modules@parcel\utils\lib\PromiseQueue.js:88:7) at async PromiseQueue._next (\node_modules@parcel\package-manager\node_modules@parcel\utils\lib\PromiseQueue.js:75:5)

🔦 Context

idea2app/React-MobX-Bootstrap-ts#1

💻 Code Sample

src/index.html

<head>
    <link rel="manifest" href="manifest.json" />
</head>

run command without @parcel/transformer-webmanifest installed:

parcel src/index.html --open

🌍 Your Environment

Software Version(s)
Parcel 2.0.0
Node 14.17.6
NPM 6.14.15
Operating System Windows 10 Pro 21H1
terminal Git Bash

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:2
  • Comments:5

github_iconTop GitHub Comments

4reactions
TechQuerycommented, Oct 22, 2021

Finally, I got a configure file of Zero-configuration Bundler to finish my migration journey:

{
    "extends": "@parcel/config-default",
    "transformers": {
        "*.{css,less}": [
            "@parcel/transformer-postcss"
        ],
        "*.webmanifest": [
            "@parcel/transformer-webmanifest"
        ],
        "*.{ts,tsx}": [
            "@parcel/transformer-typescript-tsc"
        ],
        "*.{png}": [
            "@parcel/transformer-raw"
        ]
    }
}

And have fun with my fat package.json of React-TypeScript PWA:

{
    "devDependencies": {
        "@parcel/config-default": "^2.0.0",
        "@parcel/packager-raw-url": "^2.0.0",
        "@parcel/transformer-less": "^2.0.0",
        "@parcel/transformer-postcss": "^2.0.0",
        "@parcel/transformer-raw": "^2.0.0",
        "@parcel/transformer-typescript-tsc": "^2.0.0",
        "@parcel/transformer-webmanifest": "^2.0.0",
        "@types/react": "^17.0.31",
        "@types/react-dom": "^17.0.10",
        "@types/react-router-dom": "^5.3.1",
        "autoprefixer": "^10.3.7",
        "less": "^4.1.2",
        "parcel": "^2.0.0",
        "postcss": "^8.3.11",
        "typescript": "^4.4.4",
        "workbox-cli": "^6.3.0"
    }
}
0reactions
TechQuerycommented, Sep 24, 2022

@parcel-bundler Parcel failed to install packages automatically with PNPM too, there must be something wrong: #8304

Read more comments on GitHub >

github_iconTop Results From Across the Web

Parcel
Parcel automatically tracks all of the files, configuration, plugins, and dev dependencies that are involved in your build, and granularly invalidates the ...
Read more >
Parcel 2 RC
This is completely automatic – Parcel detects the version of React used by your code and chooses the correct JSX runtime accordingly.
Read more >
Development - Parcel
Parcel automatically tracks all of the files, configuration, plugins, and dev dependencies that are involved in your build, and granularly invalidates the cache ......
Read more >
Parcel v2.8.0
We are excited to announce the release of Parcel v2.8.0! This release includes a brand new bundling algorithm with improved automatic code ...
Read more >
React - Parcel
First, install react and react-dom into your project: yarn add react react-dom ... Parcel supports JSX automatically when it detects you are using...
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