Parcel API not working
See original GitHub issue๐ bug report
When I use the cli the project is building properly. But when I use Parcel API from @parcel/core no bundles are generated.
๐ Configuration (.babelrc, package.json, cli command)
Using default parcel config
{
"name": "parcel-test",
"version": "1.0.0",
"description": "",
"scripts": {
"start": "node server.js",
"build": "parcel build index.html"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"react": "^17.0.2",
"react-dom": "^17.0.2"
},
"devDependencies": {
"@parcel/config-default": "^2.0.0",
"parcel": "^2.0.0"
}
}
๐ค Expected Behavior
Parcel should create assets in local filesystem.
๐ฏ Current Behavior
No bundles are created. And bundle graph is empty object.
๐ Possible Solution
๐ฆ Context
๐ป Code Sample
const { default: Parcel } = require('@parcel/core');
const { NodeFS } = require('@parcel/fs');
const { join } = require('path');
const bundler = new Parcel({
defaultConfig: "@parcel/config-default",
entrypoints: [join(process.cwd(), 'index.html')],
outputFS: new NodeFS()
});
bundler.run().then(console.log).catch(console.error);
See https://github.com/Devil7DK/Parcel-API-Test
๐ Your Environment
Software | Version(s) |
---|---|
Parcel | 2.0.0 |
Node | 14.17.3 |
npm/Yarn | 6.14.13 |
Operating System | Windows |
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (1 by maintainers)
Top Results From Across the Web
Diagnostics and Logging - Parcel
Parcel includes support for rich diagnostics that are used to describe errors and warnings in a format-agnostic way. It also includes a built...
Read more >Issue when trying to start parcel development server
I installed it to my project using the npm install parcel command. Then I tried to start the development server by running the...
Read more >Parcels API | single-spa
Most parcel methods will be called on the parcel itself, with the exception ... that returns a promise that resolves with the object...
Read more >API Tech Support Guide - UPS
2017 United Parcel Service of America, Inc. All rights reserved. ... Code of Federal Regulations, Title 49 (49CFR) This API works in conjunction...
Read more >How to Bundle a Web App with Parcel.js - DigitalOcean
You will be working interchangeably with a text editor and a terminal. ... files in this scenario are not meant to be edited...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
What I actually ended up doing to get this to work was to create two bundlers:
That way I could have my server running and watching for changes and my client running with HMR enabled as well.
Hi @Myrga
I have moved to a different bundler in that project due to this issue and another one.
Anyway, will try the solution you have given in my sample.
Thank you.