babel / babel/babel-loader

Unable to transpile ES6 class with Babel7 WebPack4 on Windows

Open
#810 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
4.8k
Forks
456
Avg merge
9h 19m
Merged PRs (30d)
2

Description

Hello, I'm submitting a bug report.
I spent several hours but nothing seems to work. The issue here is related when babel trying to transpile some ES6 Javascript Class files, **on windows environement.**
Babel Loader doesn't seem to find the mandatory plugin "@babel/plugin-proposal-class-properties" on Windows.

The compiling error says :
**Module build failed (from ./node_modules/babel-loader/lib/index.js):
SyntaxError: C:\WTServer\WWW\webpack-issue\src\js\components\ScrollControl.js: Support for the experimental syntax 'classProperties' isn't currently enabled (5:11):**

But actually, Babel is not able to interpret any JS Class file, and probably because no loader was initialized correctly

I've also try to follow the guideline by using with Babel7 the dedicated file **"babel.config.js"** but this file is never loaded. In webpack.config.js, I have the correct declaration with Babel (I've just used it with the "require" syntax to make sure with Windows that files are correctly loaded".

The same projet work successfully on Linux (Ubuntu 16.04 LTS), it seems to related to Windows Env only.

**Webpack Version:**
4.29

**Babel Core Version**:
7.4

**Babel Loader Version**:
8.0.5

**Please tell us about your environment:**
Windows 10

**Current behavior:**
Transpiling failed

**Expected/desired behavior:**
Working Transpiling

** How to reproduce the bug **
To help to reproduce the current issue I'm facing of, I've set a dedicated githup repo. You just need to install modules by typing "npm install" and then the following command "npm run watch-dev"

Repo : https://github.com/ricoudev/webpack-issue

* **What is the expected behavior?**

* **What is the motivation / use case for changing the behavior?**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.