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

Updated to latest release causes compiler errors. #118

Closed
niemyjski opened this issue Jul 31, 2017 · 18 comments
Closed

Updated to latest release causes compiler errors. #118

niemyjski opened this issue Jul 31, 2017 · 18 comments
Assignees

Comments

@niemyjski
Copy link

niemyjski commented Jul 31, 2017

I just updated to rc3 and I'm seeing the following starting to occur in my project with the latest webpack 3 + rc3 plugin.

Is this a known issue?

ERROR in [at-loader] ./node_modules/aurelia-webpack-plugin/dist/types/AureliaDependenciesPlugin.d.ts:4:29 
webpack: Failed to compile.
    TS2694: Namespace 'Webpack' has no exported member 'Compiler'.

ERROR in [at-loader] ./node_modules/aurelia-webpack-plugin/dist/types/AureliaPlugin.d.ts:27:29 
    TS2694: Namespace 'Webpack' has no exported member 'Compiler'.

ERROR in [at-loader] ./node_modules/aurelia-webpack-plugin/dist/types/AureliaPlugin.d.ts:28:31 
    TS2694: Namespace 'Webpack' has no exported member 'Options'.

ERROR in [at-loader] ./node_modules/aurelia-webpack-plugin/dist/types/BaseIncludePlugin.d.ts:1:56 
    TS2304: Cannot find name 'DependencyOptionsEx'.

.....



ERROR in [at-loader] ./node_modules/aurelia-webpack-plugin/dist/types/GlobDependenciesPlugin.d.ts:2:16 
    TS2665: Invalid module name in augmentation. Module 'minimatch' resolves to an untyped module at '..../node_modules/minimatch/minimatch.js', which cannot be augmented.
@vincentw56
Copy link

I am getting the same.

@Miklet
Copy link

Miklet commented Aug 2, 2017

I have also just updated to the newest rc version and got other compile error when using ModuleConcatenationPlugin:
Error: Can't figure out a normalized module name for undefined, please call PLATFORM.moduleName() somewhere to help.

Seems like I get this error when requesting \\node_modules\\aurelia-validation\\dist\\native-modules\\validate-binding-behavior.js' from aurelia-validation.

@Robula
Copy link

Robula commented Aug 4, 2017

Similar issues here.

Cannot find namespace 'Webpack'.
Cannot find name 'DependencyOptionsEx'.

Rolled back to RC2 in the meantime.
Thank you

@vincentw56
Copy link

Funny thing is I haven't had any issues with it. I mean I get the errors, but it still works fine. At least for me, everything still works as expected.

@jods4
Copy link
Contributor

jods4 commented Aug 4, 2017

Those errors don't impact runtime, it's just bad TS definitions apparently.

Do you guys use a Typescript webpack.config.ts?

Or does it really come from your app compilation? If so, that's rather strange because the .d.ts in question are for compile-time components. They shouldn't be picked up by your build.

I notice at-loader (awesome TS loader) in the original issue. Is it relevant or is it the same with ts-loader?

@Miklet that's unrelated, please open another issue. Aurelia webpack plugin RC3 should have brought compatibility with ModuleConcatenationPlugin, are you sure you're not using the RC2 bits?

@jods4 jods4 self-assigned this Aug 4, 2017
@jods4
Copy link
Contributor

jods4 commented Aug 4, 2017

I received a repro.

It used awesome TS loader but the error went away when I switched to ts-loader.

I'm not too familiar with at-loader, I'll dig the docs later.
For some reason it includes in the compilation .d.ts files that should not be included (it's the type defs for the compile-time plugin).

@vincentw56
Copy link

I use at-loader. It is during the build process and not from the webpack.config file. Here is a list of my errors:

ERROR in [at-loader] ./node_modules/aurelia-webpack-plugin/dist/types/AureliaDependenciesPlugin.d.ts:4:21
    TS2503: Cannot find namespace 'Webpack'.

ERROR in [at-loader] ./node_modules/aurelia-webpack-plugin/dist/types/AureliaPlugin.d.ts:27:21
    TS2503: Cannot find namespace 'Webpack'.

ERROR in [at-loader] ./node_modules/aurelia-webpack-plugin/dist/types/AureliaPlugin.d.ts:28:23
    TS2503: Cannot find namespace 'Webpack'.

ERROR in [at-loader] ./node_modules/aurelia-webpack-plugin/dist/types/BaseIncludePlugin.d.ts:1:56
    TS2304: Cannot find name 'DependencyOptionsEx'.

ERROR in [at-loader] ./node_modules/aurelia-webpack-plugin/dist/types/BaseIncludePlugin.d.ts:3:21
    TS2503: Cannot find namespace 'Webpack'.

ERROR in [at-loader] ./node_modules/aurelia-webpack-plugin/dist/types/BaseIncludePlugin.d.ts:4:25
    TS2503: Cannot find namespace 'Webpack'.

ERROR in [at-loader] ./node_modules/aurelia-webpack-plugin/dist/types/BaseIncludePlugin.d.ts:4:54
    TS2503: Cannot find namespace 'Webpack'.

ERROR in [at-loader] ./node_modules/aurelia-webpack-plugin/dist/types/ConventionDependenciesPlugin.d.ts:10:25
    TS2503: Cannot find namespace 'Webpack'.

ERROR in [at-loader] ./node_modules/aurelia-webpack-plugin/dist/types/ConventionDependenciesPlugin.d.ts:10:54
    TS2503: Cannot find namespace 'Webpack'.

ERROR in [at-loader] ./node_modules/aurelia-webpack-plugin/dist/types/DistPlugin.d.ts:4:21
    TS2503: Cannot find namespace 'Webpack'.

ERROR in [at-loader] ./node_modules/aurelia-webpack-plugin/dist/types/GlobDependenciesPlugin.d.ts:2:16
    TS2665: Invalid module name in augmentation. Module 'minimatch' resolves to an untyped module at 'C:/_SourceFiles/OuterLimitTech/IGCCharityGaming/IGCCharityGaming.WebUI/node_modules/minimatch/minimatch.js', which cannot be augmented.

ERROR in [at-loader] ./node_modules/aurelia-webpack-plugin/dist/types/GlobDependenciesPlugin.d.ts:17:21
    TS2503: Cannot find namespace 'Webpack'.

ERROR in [at-loader] ./node_modules/aurelia-webpack-plugin/dist/types/GlobDependenciesPlugin.d.ts:18:25
    TS2503: Cannot find namespace 'Webpack'.

ERROR in [at-loader] ./node_modules/aurelia-webpack-plugin/dist/types/GlobDependenciesPlugin.d.ts:18:54
    TS2503: Cannot find namespace 'Webpack'.

ERROR in [at-loader] ./node_modules/aurelia-webpack-plugin/dist/types/HtmlDependenciesPlugin.d.ts:3:25
    TS2503: Cannot find namespace 'Webpack'.

ERROR in [at-loader] ./node_modules/aurelia-webpack-plugin/dist/types/HtmlDependenciesPlugin.d.ts:3:54
    TS2503: Cannot find namespace 'Webpack'.

ERROR in [at-loader] ./node_modules/aurelia-webpack-plugin/dist/types/ModuleDependenciesPlugin.d.ts:3:44
    TS2304: Cannot find name 'DependencyOptionsEx'.

ERROR in [at-loader] ./node_modules/aurelia-webpack-plugin/dist/types/ModuleDependenciesPlugin.d.ts:3:88
    TS2304: Cannot find name 'DependencyOptionsEx'.

ERROR in [at-loader] ./node_modules/aurelia-webpack-plugin/dist/types/ModuleDependenciesPlugin.d.ts:8:35
    TS2304: Cannot find name 'DependencyOptionsEx'.

ERROR in [at-loader] ./node_modules/aurelia-webpack-plugin/dist/types/ModuleDependenciesPlugin.d.ts:11:37
    TS2304: Cannot find name 'DependencyOptionsEx'.

ERROR in [at-loader] ./node_modules/aurelia-webpack-plugin/dist/types/ModuleDependenciesPlugin.d.ts:17:21
    TS2503: Cannot find namespace 'Webpack'.

ERROR in [at-loader] ./node_modules/aurelia-webpack-plugin/dist/types/ModuleDependenciesPlugin.d.ts:18:25
    TS2503: Cannot find namespace 'Webpack'.

ERROR in [at-loader] ./node_modules/aurelia-webpack-plugin/dist/types/ModuleDependenciesPlugin.d.ts:18:54
    TS2503: Cannot find namespace 'Webpack'.

ERROR in [at-loader] ./node_modules/aurelia-webpack-plugin/dist/types/PreserveExportsPlugin.d.ts:3:21
    TS2503: Cannot find namespace 'Webpack'.

ERROR in [at-loader] ./node_modules/aurelia-webpack-plugin/dist/types/PreserveModuleNamePlugin.d.ts:5:21
    TS2503: Cannot find namespace 'Webpack'.

@Vheissu
Copy link
Member

Vheissu commented Aug 9, 2017

Another at-loader user here and experiencing the same issue as above from @vincentw56

@Vheissu
Copy link
Member

Vheissu commented Aug 18, 2017

I can confirm using ts-loader fixes the issue. The main issue however, is the official Webpack TypeScript skeleton uses Awesome TypeScript Loader which is probably the reason this is affecting people. Do we fix the issue with ATS or just move the skeletons (which will be sunset soon anyway) to ts loader?

@vincentw56
Copy link

Is ts-loader better than at-loader? From what I've seen, at-loader is faster. Maybe that has changed.

@Robula
Copy link

Robula commented Aug 18, 2017

I was also using at-loader along with a webpack.config.ts file.

@jods4
Copy link
Contributor

jods4 commented Aug 18, 2017

@Vheissu I'd like to try to figure out why at-loader behaves this way and if it can be fixed before changing the skeletons.
Haven't had the time to so far :(

@vincentw56
Copy link

I tried switching to ts-loader, but that just caused a bunch of other errors. Plus, ts-loader is so much slower than at-loader.

@JeroenVinke
Copy link

We've just hit this in the CLI. aurelia/cli#700 (comment) is a good solution until we can figure out what's going on

@JeroenVinke
Copy link

I may have some clues.

The webpack typescript definition has import statements, which makes it a module: microsoft/TypeScript#5506 (comment). So you need to import it before using it.

The typescript definitions of the webpack plugin doesn't do this: https://github.com/aurelia/webpack-plugin/blob/master/dist/types/AureliaPlugin.d.ts#L27-L28. This wasn't a problem until this change that adds the typings file to package.json.

@jods4
Copy link
Contributor

jods4 commented Aug 24, 2017

We found that removing typings from project.json works around the issue, i.e. at-loader does not include those definitions in the compilation anymore.

We'll publish this work-around until a better solution is found, I opened s-panferov/awesome-typescript-loader#484.

If you used those definition to build webpack.config.js from TS sources, you'll need to import them manually until the work-around is reversed.

@jods4
Copy link
Contributor

jods4 commented Nov 1, 2017

A few months later... clarifying the status of this open issue:

  • the issue occurs no more because of published work-around above. It would be nice to bring back typings but it's not critical.
  • the issue at awesome-typescript-loader has gotten zero reply 😞

@jods4
Copy link
Contributor

jods4 commented Apr 16, 2018

I'm closing this as we worked-around the issue by removing typings.

#143 tracks adding them back, but I'm not sure if/when it's gonna happen, given the lack of support from awesome-typescript-loader.

@jods4 jods4 closed this as completed Apr 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants