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

A project breaks at startup and build when using "source" in package.json #7843

Closed
ziplb opened this issue Mar 18, 2022 · 4 comments
Closed

Comments

@ziplb
Copy link

ziplb commented Mar 18, 2022

πŸ› bug report

A project breaks at startup and build if the source file(e.g. index.html) is specified using property source in package.json.

πŸŽ› Configuration (.babelrc, package.json, cli command)

Project structure:

outer-dir/
β”œβ”€ example/
β”‚  β”œβ”€ public/
β”‚  β”‚  β”œβ”€ mainfest.json
β”‚  β”œβ”€ src/
β”‚  β”‚  β”œβ”€ index.html
β”‚  β”œβ”€ package.json
β”‚  β”œβ”€ yarn.lock
β”œβ”€ yarn.lock

package.json:

{
  ...
  "source": "src/index.html",
  "scripts": {
    "start": "parcel",
    "build": "parcel build"
  },
  "devDependencies": {
    "@parcel/transformer-webmanifest": "2.3.2",
    "parcel": "^2.3.2",
    ...
  },
  ...
}

πŸ€” Expected Behavior

Commands parcel and parcel build run without error.

😯 Current Behavior

To process manifest.json, Parcel needs @parcel/transformer-webmanifest that it cannot find and crashes with an error. The same happens with other packages needed to run or build a project. It seems that Parcel finds the most top-level yarn.lock and tries to resolve node_modules there.

πŸ’ Possible Solution

I assume that somewhere in the code there is an error due to which the collector is looking not for the first package.json, but for the last.

πŸ”¦ Context

I caught this error completely by accident and had absolutely no idea that I might have yarn.lock up the tree that somehow got there.

πŸ’» Code Sample

Here is a repository with an example to reproduce the issue.

🌍 Your Environment

Software Version(s)
Parcel 2.3.2
Node 16.13.1
npm/Yarn yarn v.1.22.17
Operating System macOs Monterey
@Shinyaigeek
Copy link
Contributor

Shinyaigeek commented Mar 20, 2022

this seems to going to be fixed with #7537

@ziplb
Copy link
Author

ziplb commented Mar 21, 2022

@Shinyaigeek It seems to me that the above bug was not fixed in the task #7537. I caught the bug in the newest available version 2.3.2.

@Shinyaigeek
Copy link
Contributor

@ziplb the above PR is still in review. Please try again after the PR will be merged and nightly version including this fix will be released

@ziplb
Copy link
Author

ziplb commented Mar 21, 2022

@Shinyaigeek Thank you!

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

3 participants