Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2.8.0 Throws an error when webpack entry is a CSS file #1238

Closed
Nikodermus opened this issue Nov 19, 2019 · 3 comments
Closed

v2.8.0 Throws an error when webpack entry is a CSS file #1238

Nikodermus opened this issue Nov 19, 2019 · 3 comments
Labels
awaiting response Issues waiting for a reply from the OP or another party package: parser Issues related to @typescript-eslint/parser

Comments

@Nikodermus
Copy link

What code were you trying to parse?
My regular codebase, I'm using a css entry in webpack as

config.entry = ['./src/VenueMap.css', './src/VenueMap.ts'];

What did you expect to happen?
Ignore the CSS file and parse only the TS file

    config.module.rules.push({
                enforce: 'pre',
                exclude: /node_modules/,
                loader: 'eslint-loader',
                test: /\.(js|ts)$/,
                options: {
                    fix: true
                }
            });

What actually happened?
It throws the following error:

ERROR  in ./src/VenueMap.ts
Module build failed (from ./node_modules/eslint-loader/dist/cjs.js):
TypeError: Cannot read property '0' of undefined
    at Linter.autoFix (/Users/liam/projects/maps/venue-map-component/node_modules/eslint-loader/dist/Linter.js:117:20)
    at Linter.printOutput (/Users/liam/projects/maps/venue-map-component/node_modules/eslint-loader/dist/Linter.js:77:12)
    at Object.loader (/Users/liam/projects/maps/venue-map-component/node_modules/eslint-loader/dist/index.js:26:10)
 @ multi ./src/VenueMap.css ./src/VenueMap.ts main[1]
✖ Creating UMD builds
Error running command: Build failed with errors.
Error: Build failed with errors.
    at compiler.run (/Users/liam/projects/maps/venue-map-component/node_modules/nwb/lib/webpackBuild.js:76:17)
    at finalCallback (/Users/liam/projects/maps/venue-map-component/node_modules/nwb/node_modules/webpack/lib/Compiler.js:210:39)
    at hooks.done.callAsync.err (/Users/liam/projects/maps/venue-map-component/node_modules/nwb/node_modules/webpack/lib/Compiler.js:259:14)
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/liam/projects/maps/venue-map-component/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:15:1)
    at AsyncSeriesHook.lazyCompileHook (/Users/liam/projects/maps/venue-map-component/node_modules/tapable/lib/Hook.js:154:20)
    at emitRecords.err (/Users/liam/projects/maps/venue-map-component/node_modules/nwb/node_modules/webpack/lib/Compiler.js:257:22)
    at Compiler.emitRecords (/Users/liam/projects/maps/venue-map-component/node_modules/nwb/node_modules/webpack/lib/Compiler.js:372:39)
    at emitAssets.err (/Users/liam/projects/maps/venue-map-component/node_modules/nwb/node_modules/webpack/lib/Compiler.js:251:10)
    at hooks.afterEmit.callAsync.err (/Users/liam/projects/maps/venue-map-component/node_modules/nwb/node_modules/webpack/lib/Compiler.js:358:14)
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/liam/projects/maps/venue-map-component/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:15:1)
    at AsyncSeriesHook.lazyCompileHook (/Users/liam/projects/maps/venue-map-component/node_modules/tapable/lib/Hook.js:154:20)
    at asyncLib.forEach.err (/Users/liam/projects/maps/venue-map-component/node_modules/nwb/node_modules/webpack/lib/Compiler.js:355:27)
    at /Users/liam/projects/maps/venue-map-component/node_modules/neo-async/async.js:2830:7
    at done (/Users/liam/projects/maps/venue-map-component/node_modules/neo-async/async.js:2865:11)
    at /Users/liam/projects/maps/venue-map-component/node_modules/neo-async/async.js:2818:7
    at /Users/liam/projects/maps/venue-map-component/node_modules/graceful-fs/graceful-fs.js:57:14

Versions

package version
@typescript-eslint/parser 2.8.0
TypeScript 3.7.2
ESLint 6.6.0
node 12.13.0
npm 6.12.0

Workaround
I fixed parser and eslint-plugin version to 2.7.0 and it works

@Nikodermus Nikodermus added package: parser Issues related to @typescript-eslint/parser triage Waiting for maintainers to take a look labels Nov 19, 2019
@bradzacher bradzacher added awaiting response Issues waiting for a reply from the OP or another party and removed triage Waiting for maintainers to take a look labels Nov 19, 2019
@bradzacher
Copy link
Member

Thanks for reporting.

Could you please provide a more minimal repro case? You've got a webpack environment setup, but we don't.
We don't have the spare time to learn how to use webpack + css-loader, and then figure out how to repro your environment and config.

If you could create an small, isolated example repo which shows the bug, it would make it easier to investigate.

@glen-84
Copy link
Contributor

glen-84 commented Nov 19, 2019

@bradzacher
Copy link
Member

Interesting - so according to that issue the exact same bug is triggered without using our plugin/parser.
I'm going to assume that this is not a bug in our project then, and close this.

If it turns out that it is a bug in here, feel free to comment with more info and we can reopen and investigate.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
awaiting response Issues waiting for a reply from the OP or another party package: parser Issues related to @typescript-eslint/parser
Projects
None yet
Development

No branches or pull requests

3 participants