Questions tagged [parceljs]

Blazing fast, zero configuration web application bundler

Official website

https://parceljs.org/

407 questions
76
votes
6 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
  • 1,165
  • 2
  • 6
  • 20
15
votes
2 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
  • 179
  • 2
  • 8
15
votes
2 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,000
  • 40
  • 141
  • 232
14
votes
2 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
  • 3,363
  • 8
  • 31
  • 58
13
votes
1 answer

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,233
  • 10
  • 25
13
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
  • 2,968
  • 3
  • 23
  • 49
12
votes
2 answers

Apollo-client with parcel warnings

Have been trying to setup apollo-client with parcel for my react app. Things work fine but in the console, there are plenty of warnings regarding missing source files in node_modules/apollo-client in my CI pipeline. Have tried clearing yarn cache,…
Abhijeet
  • 637
  • 5
  • 14
11
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
  • 27,053
  • 14
  • 78
  • 109
11
votes
5 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…
romanrogers
  • 451
  • 5
  • 20
11
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
  • 591
  • 10
  • 28
10
votes
1 answer

Parceljs build UMD

I am trying to build a module using the module-bundler ParcelJS. I would like this certain module to be import-friendly: it should be import friendly (ES6) It should be require friendly (Node) It should be script-src friendly (Browser) It should…
Verhulstd
  • 241
  • 2
  • 10
10
votes
2 answers

Loading images dynamically with Parceljs

Is it possible to load images dynamically with parceljs bundler, when image names are not known at build time Is there something similar to webpack's require.context in parcel Code Snippet (using React and Parcel) This works fine ...
9
votes
1 answer

Vue SSR (Server Side Rendering) with parcel?

I am wondering whether anyone can point me to resources or examples on how to set up parcel for vue SSR (Server Side Rendering). Or is Vue SSR not possible with parcel?
LongHike
  • 2,426
  • 1
  • 23
  • 42
8
votes
1 answer

Parcel Bundler: import scss files from node_modules without specifying the full path?

Currently, I import scss files like this: @import './node_modules/bulma/bulma'; However, in Laravel Mix I learned that I could just import the files like this, without specifying ./node_modules: @import '~bulma/bulma'; Anyway I could do this in…
Joshua Leung
  • 1,819
  • 4
  • 18
  • 42
7
votes
1 answer

Using native ECMAScript modules in Babeljs config

I'm very, very confused about using babel config with native ECMAScript modules, and "type": "module" set in package.json. As far as I understand Babel docs (here, under "Supported file extensions"), its should be possible. But if I try with config…
boojum
  • 415
  • 3
  • 15
1
2 3
27 28