690 questions
3
votes
2
answers
87
views
Parcel Not Bundling Dynamically Fetched HTML Files
I have a simple HTML, CSS, JS app that I'm trying to bundle. I noticed that when using fetch() within an HTML file to insert a partial HTML file like this:
fetch('../partials/header.html')
.then(...
2
votes
0
answers
52
views
DuckDB bundle issue on my Parcel application
I'm working on a Parcel frontend project using DuckDB, and it runs well in the Production environment. However, in my local machine the browser displays this error.
And as I've just mentioned, this ...
3
votes
1
answer
71
views
When I run 'npm run watch:js', it changes app.js file code
I have a Node.js project, and after the Parcel update, I’m running into an issue.
In my ./public/js/ folder I have two files: bundle.js and bundle.js.map.
Previously, Parcel was compiling/bundling the ...
0
votes
0
answers
23
views
The "distDir" output is not showing up for Parcel 2.13.3 "build" execution
I've been trying to get an output from Parcel for quite a while with no luck. Initially, I had a "main" element at the top of package.json. I read that this is not recommended, so in my &...
2
votes
1
answer
87
views
Parcel resolver-glob is not working as expected after upgrading to 2.14.4
I recently upgraded one of my project's ParcelJS from version 2.13.3 to 2.14.4. Everything works as expected, except for the glob imports.
JS
import images from "../../../img/gallery/*.jpg";
...
0
votes
1
answer
41
views
Images not served as image/png but as html/text
Using React 19, Node 18 and Parcel 2, I have React component that is defined this way :
// @ts-expect-error url module is in Node
import myLogo from "../../assets/my_logo.png";
export const ...
1
vote
1
answer
77
views
Invalid path setting in background image of tailwindcss with parcel
I am using parcel with tailwindcss for my project. I have installed parcel, tailwindcss, @tailwindcss/postcss according to the original docs in tailwind. My html tag looks like this:
<div class=&...
0
votes
0
answers
112
views
SVG sprite icon not showing when I deployed the web app
SVG sprite icon not showing when I deployed the web app. On the console when you inspect, they are there, but not showing, I noticed the svg icon has its height x width = 0x0. I don't experience this ...
0
votes
1
answer
70
views
@parcel/transformer-js build failed
I run parcel2 build command:
parcel build src/web/index.html
and I got the following error
➜ my-webapp git:(master) ✗ npm run build-dev
> [email protected] build-dev
> parcel build src/web/index....
0
votes
0
answers
101
views
Parcel Build Failure: "Got Unexpected Null" Error When Exporting a Namespace with Enums
I'm encountering a build error in my package. I've created a minimal reproduction of the issue here: https://github.com/mannam95/ts-export.
Background
I have a namespace called GLOBALENUMS defined as ...
1
vote
1
answer
299
views
Parcel fails to build when there's a "main: false" in a dependency's package.json
I'm using Parcel to build. We recently upgraded to Node 20 LTS (a month ago) so maybe that's something to do with it.
When I run parcel build in a Docker container with a freshly sync'ed down ...
0
votes
0
answers
20
views
Parcel bundler ignores the targets defined through the JS API
We're trying to compose a simple dev setup based on the Parcel bundler. The goal is to build two separate things:
a JS app with entry point at src/app.jsx and output target at dist/js/app.js;
a plain ...
0
votes
1
answer
85
views
`Got unexpected undefined` when using Parcel in a Nix shell
I'm trying to set up a very basic nix shell (using flake) to build a Parcel project.
I have a flake.nix file like this:
{
description = "My Project";
inputs = {
nixpkgs.url = "...
0
votes
1
answer
57
views
Parcel "npm run build:js" changes app.js file and not bundle.js
I have a Node.js project and after the Parcel update I'm running into an issue.
In my ./public/js/ folder I have 2 files: bundle.js and bundle.js.map. Previously Parcel was compiling/ bundling the ...
0
votes
1
answer
62
views
Getting error "non-top-level require() call" with no require() beign used
I'm trying to move a web made with vanilla JS to node.js and I'm getting this error using Parcel2:
@parcel/transformer-js: Conditional or non-top-level `require()` call. This causes the resolved ...
0
votes
1
answer
34
views
Parcel.js not causing any errors with invalid imports or invalid type aliases
I have this very basic Node.JS application:
index.html
<!DOCTYPE html>
<html><head><meta charset="UTF-8">
<script type="module" src="index.ts"&...
1
vote
0
answers
37
views
How to prevent parcel from moving images around?
Trying to use webgl to render a texture, and I am using some npm libraries so I am using .cjs files and using parcel to run it. When I try to get the image from my resources file it doesnt work ...
0
votes
1
answer
46
views
Parcel build differs from localhost
I'm developing a small webapp with parcel to display some charts. I'm using
https://parceljs.org/
https://www.chartjs.org/
https://www.chartjs.org/chartjs-plugin-annotation/latest/
My app runs ...
0
votes
0
answers
138
views
Minify CSS in Parcel dev mode
I'm trying to get Parcel to minify my CSS in dev mode, but I'm not sure it's possible.
The Parcel docs give the impression you can configure targets like this, but also mention minification only takes ...
0
votes
1
answer
190
views
Why don't HTML elements render in Preact?
I'm working on a Preact project, and this is the code of a page:
return (
<Fragment>
<div style={gridStyle}>
<p>Test</p>
</div>
&...
1
vote
1
answer
1k
views
AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value: (0, _assert().default)(node.type === OPTION) [closed]
at RequestGraph.invalidateOptionNodes (food-ordering-app\node_modules@parcel\core\lib\RequestTracker.js:249:29)
at loadRequestGraph (food-ordering-app\node_modules@parcel\core\lib\RequestTracker.js:...
1
vote
1
answer
136
views
How to get the use-sound hook working with Parcel?
I've started building React websites with Parcel and want to use the use-sound hook, but Parcel is giving me issues.
Specifically, I am seeing the following error:
ReferenceError: HowlerGlobal is not ...
0
votes
1
answer
129
views
CSS imports aren't working from javascript files bundling with Parcel.js
I'm facing an issue regarding importing CSS in .tsx files after upgrading Parcel.js from 2.9.0 to 2.12.0 in a project.
My project is using React, TypeScript and CSS. I'm not using CSS modules. The CSS ...
1
vote
0
answers
143
views
Encountered error: @parcel/optimizer-swc: 'const' declarations must be initialized (during build process)
I encountered an error during the build process with Parcel, specifically from the @parcel/optimizer-swc module, stating that 'const' declarations must be initialized. However, this error doesn't ...
0
votes
0
answers
50
views
Can not use my own local React library: module.js does not export 'Hello'
I have a local typescript project with a simple React component, Hello:
import * as React from "react";
import { useState } from "react";
const Hello = () => {
const [x11, ...
0
votes
0
answers
181
views
How to symlink react components
I'm trying to share some react components across multiple projects in an easy way. If I symlink the .tsx file into my web folder, node compiler fails with this error:
@parcel/core: Failed to resolve '...
0
votes
1
answer
112
views
How can I use dynamic Parcel 2 aliases?
Parcel 2 supports glob aliases for simple use cases, but I can't figure out how to use it for global object properties that require some transformation.
For example, in WordPress projects, wp is a ...
0
votes
0
answers
60
views
i encountered an issue with react app not showing any data in mobile view
Body.js
import RestaurantCard, { withBestSellerLabel } from "./RestaurantCard";
import { useEffect, useState, useContext } from "react";
import Shimmer from "./Shimmer";
...
2
votes
1
answer
168
views
ParcelJS: Error: Does not have node 17172 when running dev server
seem to having an issue with ParcelJS. It was working and the build compiling with no issues. Went to restart the development server and now have an issue and it wont work. It throws the following ...
2
votes
0
answers
80
views
Parcel version upgrade is breaking Sass/CSS output
Since updating Parcel from v2.4.0 to 2.10.0, when Parcel compiles my Sass into CSS, the ordering of some of the lines of code is being changed. This is causing some styles to break.
For example - this ...
0
votes
1
answer
458
views
Issue with npm gh-pages and deployment
I've been dealing with an issue when using the gh-pages npm module wherein running npm run deploy is not triggering deployment on GitHub reliably - sometimes it works, most of the time it doesn't.
I'...
0
votes
0
answers
14
views
ParcelJs can not compile tsx dependency
I'm trying to use a local dependency which is a simple .tsx Hello component. When I run parcel serve command it fails as below:
@parcel/transformer-js: Expected '>', got 'onClick'
/...ello.tsx:6:...
1
vote
0
answers
70
views
ParcelJS: Cannot find module error randomly
This happens randomly. When I edit a tsx file (e.g. a data view page), next time I render the web page, it says Error: Cannot find module '../../component/primitive/TextBox' (or some other primitive ...
0
votes
1
answer
91
views
Get certificate from async function?
I am trying to convert my build of a JavaSript Outlook Add-In from webpack to parceljs.
Mostly works, but fails on the configuration of the certificate for https.
The webpack configuration used an npm ...
1
vote
0
answers
128
views
Parcel throws error when I want to include google app script variable
I'm trying to pass a variable to html template in app sheet.
I'm trying to use parcel to compile all the code in one html file since app script works like that.
To receive variable in html I would ...
3
votes
0
answers
166
views
React use client directive with parceljs bundler
Parceljs is unable to deal with "use client" directive. I've a monorepo (pnpm workspaces + turborepo). apps/web is dependent on pkgs/ui that includes UI components. Since components are all ...
0
votes
1
answer
96
views
My parcel React website on localhost takes 10 seconds time when opened with chrome inspect tab and loads quickly when inspect tab is not opened
I am learning react from namaste react course of akshay saini.
I created 2 files.
Index.html
script.js
Then i initiated npm init.
After that i added parcel to it and then ran the
npx parcel index.html ...
1
vote
1
answer
322
views
Migrating the existing react app from "create-react-app" to "parcel"
I have a react project on which I've used create-react-app and now I have come to know about the advantages of using parcel so now I want to use the parcel for building the rest of the project.
I ...
0
votes
0
answers
67
views
Cannot package electron js app built on top of a react web app
I'm trying to package and distribute my electron js desktop application, built on top of a react web application using parcel as a bundler.
To do this, i'm using the following cmds:
npm run build to ...
0
votes
0
answers
176
views
basic-ftp moduleHas anyone managed to use webpack or Parcel with
I have tried using webpack 5 and Parcel to build the new .js files.
The javascript file before conversion works fine with node in the command prompt but I cannot get it to work in Windows (11). I am ...
0
votes
1
answer
152
views
gh-page hosting Parcel v2 built project contains static image assets that would not be displayed when live
Project website hosting on https://bigyajuu.github.io/my-portfolio/. The images in question are supposed to be viewed via these following clickable containers:
When deploying my project to gh-page, ...
0
votes
0
answers
54
views
Parcel changes file names used in template literals
I'm developing a memory game with JavaScript. I've decided to create tiles by injection of HTML code by template literals. Problem arises when Parcel modifies file names that have been referenced by ...
0
votes
1
answer
132
views
ParcelJs - building web extension manifest v3 doesn't resolve service_worker path
I'm building a cross-browser extension.
I see that Firefox doesn't support yet service workers, while they are mandatory for Chrome.
So, I was making some tests in Chrome but when I try to build the ...
5
votes
1
answer
370
views
Code splitting not working with parcel in react
I have this component which is from parcel's documentation. It said it should work by default.
import React from 'react';
const Router = () => {
...
const ComponentToRender = React.lazy(() =>...
1
vote
1
answer
168
views
Jest is not transforming our built design system package
We have been building a design system in our company. We are using material ui as a base. The app and the design system work fine, but we have a small problem with Jest. When running the tests, we are ...
0
votes
1
answer
527
views
How to configure ParcelJS for Chrome DevTools extension project
I maintain a Chrome DevTools extension for which I utilise Gulp to bundle my code. Since Gulp is not maintained anymore, I am looking to migrate to another bundler. I started a test project to try out ...
0
votes
1
answer
495
views
Uncaught ReferenceError: <Class> is not defined
I am trying to setup my first webapp with ParcelJS. Everything works in development but when I do a production build my class definitions are not accessible and I get the error:
app.js:5 Uncaught ...
1
vote
1
answer
1k
views
What causes `Error: spawn xdg-open ENOENT` when running Parcel in Docker?
I have a React SPA that that uses Parcel as the build tool/dev server. I'm trying to get it running inside a Docker container, but when I run the parcel serve command, I get an error like this:
$ ...
-1
votes
1
answer
127
views
Why the Slider au scroll and its distortion effect created with Three.js and Parcel.js doesn't appear any more?
I have 2 pages and page 2 contains a horizontal scrolling slider with a distortion effect created with Three.js and Parcel.js (+ cursor effect with gsap on those 2 pages).
Separately, 2 pages work ...
1
vote
0
answers
142
views
Parcel set page base url
Im trying to make my react project work with gh pages, the images are not found for some reason, but on localhost it works, <img alt="Vector" src="/img/vector-4.svg" />
I've ...