Questions tagged [parceljs]

Blazing fast, zero configuration web application bundler

Official website

https://parceljs.org/

682 questions
203
votes
19 answers

Importing images in TypeScript React - "Cannot find module"

I am trying to import images to use inside a React component with TypeScript. The bundler I'm using is Parcel (not Webpack). I have created a .d.ts file inside the project with the image file extension, and included it inside tsconfig.json. However,…
John
  • 2,675
  • 3
  • 13
  • 20
44
votes
2 answers

Parcel SemVer bug

So, I've used Parcel multiple times before and I've never had an issue with it. This time it throws some stupid errors about SemVer versioning and I'm literally loosing my mind trying to find a solution which would fix this problem. I've started new…
veilvokay
  • 461
  • 1
  • 4
  • 6
31
votes
3 answers

The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'esnext', or 'system'.ts(1343)

I keep getting "The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'esnext', or 'system'.ts(1343)" when trying to use import.meta.url (as shown in Parcel docs). Yes, I have configured my tsconfig as suggested in…
yesenia
  • 311
  • 1
  • 3
  • 3
28
votes
11 answers

Why does react-router not works at vercel?

I am trying to publish a serverless web to vercel. I want to use react-router and this works good on my computer but when I deploy it It doesn't works Can somebody help me? (I want to do it without server) // My main code import React from…
user12171726
28
votes
8 answers

TypeError: (0 , _react.useEffect) is not a function

when in the development environment, my app works just fine. When in the production environment it crashes with the error: Uncaught TypeError: (0 , _react.useEffect) is not a function It happens in a file I created where I import React and useEffect…
MLyck
  • 4,959
  • 13
  • 43
  • 74
26
votes
1 answer

How do I use jQuery and jQuery-ui with Parcel (bundler)?

I installed jquery(3.2.1) and jquery-ui-dist(1.12.1) via npm. (they're not included as script tags in html) In client script I use: window.$ = require('jquery');// plain jQuery stuff works fine import 'jquery-ui-dist'; // breaks whole jQuery,…
okram
  • 810
  • 3
  • 11
  • 17
22
votes
4 answers

How to add image in react by using parcel?

I have been trying to add image in react. I'm not using webpack, I'm using parceljs. Also using typescript I have try: import image from path/to/image.png inside react component: try: try:
Josue Toledo
  • 349
  • 2
  • 3
  • 8
21
votes
5 answers

Parcel JS: tree.render is not a function

Whenever I try to run production build command npm run build or npx parcel build index.html, I get this error. I have a simple html and css project, no react, no 3rd party library Why could this be happening? I have tried parcel versions 1.12.3,…
Karanveer Singh
  • 961
  • 12
  • 27
18
votes
5 answers

Babel 7 fails with single plugin saying "Duplicate plugin/preset detected."

The plugin that fails is @babel/plugin-transform-regenerator (no marginal plugin, 1.6 milion downloads / week). This is my entire .babelrc: { "presets": [], "plugins": [ "@babel/plugin-transform-regenerator" ] } When I try to transpile it…
Rasto
  • 17,204
  • 47
  • 154
  • 245
17
votes
3 answers

How can I raise the limit for open files in Ubuntu 20.04 on WSL2?

My setup looks as follows: Windows 10, Release 1909 (Build 18363.1082), using WSL2 with an Ubuntu 20.04 environment. Everything works nicely most of the time, but there are some issues I cannot manage to solve. During development using parcel (React…
donmartin
  • 1,753
  • 2
  • 15
  • 30
15
votes
1 answer

Can I enable sourcemaps in a chrome extension?

I'm doing some test development and creating a Chrome extension using Svelte and ParcelJS and would like to see the sourcemaps in chrome dev tools. When looking at any page however I can only see the bundled code see this error: DevTools failed to…
Jason Goemaat
  • 28,692
  • 15
  • 86
  • 113
15
votes
11 answers

How to fix 'no entries found' on server run in Parcel.js

On trying to run the server with 'parcel index.js': Server running at http://localhost:1234 No entries found. at Bundler.bundle (/usr/local/lib/node_modules/parcel-bundler/src/Bundler.js:275:17) Server is showing a 404 error. I'm having…
rome
  • 539
  • 1
  • 5
  • 23
15
votes
2 answers

Can I specify the output folder for assets?

I have a project with this structure: src |- index.pug | - layout | |- index.less | - scripts | |- index.js For now, when I run parcel build src/index.pug, all the files are bundled and I've got this on the distribution folder: dist …
Renan Gomes
  • 771
  • 1
  • 15
  • 34
15
votes
1 answer

How to replace webpack with parcel in a CRA project?

I have a CRA project setup and it's working fine. However I'm considering ejecting it and replacing Webpack with Parcel.js. After ejecting, what should I do? Is the index.js file in the src folder the only file I need for Parcel?
ninesalt
  • 4,054
  • 5
  • 35
  • 75
14
votes
1 answer

Parcel: using separate SCSS files for each React component, but with a variables file

I'm trying to find my way in setting up an efficient web development workflow even though I am new to React and bundlers (and the combi of these two). My goal is to have each React component use its own SCSS file, which can't be accessed by other…
easybakeoven4
  • 141
  • 1
  • 1
  • 4
1
2 3
45 46