Questions tagged [babel-loader]

718 questions
4
votes
1 answer

Upraded Webpack 4 to 5 : Build stalls at 10% building 0/1 entries 1/1 dependencies 0/1 modules

I am upgrading my webpack from 4 to 5 , when i run webpack command webpack --progress --config webpack.config.js the progress stalls at Build stalls at 10% building 0/1 entries 1/1 dependencies 0/1 modules. This was working fine till i was using…
Anurag Sharma
  • 241
  • 1
  • 2
  • 7
4
votes
2 answers

dependency tree error using create-react-app and storybook

TLDR: how can I instruct storybook to use babel-loader v8.1.0 OR force react-scripts to use babel-loader v^8.2.2 ? Details I Develop a lib with ./example folder which is itself project created with create-react-app. I wanted to add storybook in…
Eliav Louski
  • 3,593
  • 2
  • 28
  • 52
4
votes
3 answers

Module not found: Error: You attempted to import babel-preset which falls outside of the project src/ directory

I'm developing an application created using create-react-app But then I needed to use mediainfojs library, this library requires wasm files, and based on what I understood I couldn't add it using create-react-app, I had to eject it. After ejecting…
dfranca
  • 5,156
  • 2
  • 32
  • 60
4
votes
1 answer

topLevelAwait invalid with babel-loader: 'await' is only allowed within async functions

webpack5 supports topLevelAwait, just add the following options: //webpack.config.js module.exports = { //... experiments: { topLevelAwait: true }, }; Now we can use top level await happily, like this: import Test from './Test'; const…
pandalive
  • 75
  • 1
  • 1
  • 6
4
votes
0 answers

Webpack: resolve transitive dependencies of linked modules

I'm trying to implement a node module which should be installable on another module and be responsible to bundle it into a react app for me. (similar to create react app) A simplified proof of concept can be found here example is an hello world…
4
votes
1 answer

why babel-loader is part of webpack instead babel itself?

I am learning about how build system works in JavaScript. If babel-loader is transpiler that translates React to JavaScript, why is it part of webpack plugin? Isn't transpiling and bundling is a separate process? And is there a resource that…
Ishan Patel
  • 5,571
  • 12
  • 47
  • 68
4
votes
0 answers

How to use jsx in vuepress?

Config // ./docs/.vuepress/config.js module.exports = { ... chainWebpack: (config, isServer) => { config.module .rule("js") // Find the rule. .use("babel-loader") // Find the loader .tap(options => merge(options, { …
EmiyaYang
  • 41
  • 2
4
votes
2 answers

how to fix You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file with webpack 4

I am trying to fix a plugin but cannot seem to webpack out of the box. it was originally using webpack v2 and babel 6 so i decided to upat it to wepack 4 and babel 7. even so it does not seem to webpack. the error i get is ERROR in ./src/index.js…
shorif2000
  • 2,582
  • 12
  • 65
  • 137
4
votes
0 answers

requires by babel not resolved by webpack

Babel-loader adds "require" statements due to "useBuiltIns: usage ", webpack transcribes them into import statements but doesn't resolve them. Resulting in the following inside bundle.js and an error in the browser: import…
Timar Ivo Batis
  • 1,861
  • 17
  • 21
4
votes
1 answer

babel 7 ignores files outside of current directory

Say I have following project structure (Well its more complex than below structure): CommonComponents CommonComponentA CommonComponentB package.json webpack.config.js .babelrc ModuleA ComponentC //import…
Ankit Utekar
  • 101
  • 5
4
votes
2 answers

Webpack build fails for IE (11)

Trying to setup webpack to build my .js and .vue files. Seems to no transpile _name() {} style function to regular JavaScript. Thought it should do that out of the box, straight into commons js unless otherwise specified. No idea why, it's crashing…
Rob
  • 10,851
  • 21
  • 69
  • 109
4
votes
1 answer

How do you set the Babel environment variable (BABEL_ENV) when using Babel Loader with Webpack?

How do you set the Babel environment variable (i.e. BABEL_ENV) when using the 'babel-loader' Webpack plugin? I want to be able to use different Babel configurations while using Webpack.
Fearnbuster
  • 806
  • 2
  • 14
  • 19
4
votes
1 answer

Module build failed: TypeError: Cannot read property 'context' of undefined at Object.module.exports

I got this unusual error after webpack installation, Searched whole web tried all solution but nothing works, //My webpack.config.js file const webpack = require("webpack"); const path = require("path"); const config = { entry :…
4
votes
0 answers

webpack context and resolve.modules not resolving node_modules

I'm trying to introduce webpack into a legacy project with the following folder structure: -web -project - webpack.config.js - package.json -src - client.js Everytime I run webpack --config webpack.config.js in the…
Cornel Janssen
  • 681
  • 1
  • 11
  • 33
4
votes
1 answer

*.default is not a constructor, with a imported js plugin

I tried to create a simple form validation and registered this via yarn link in a example project to test the set up. But it absolutely doesn't work and I have no idea how to continue. export default class Proofr { constructor() { …