Skip to content
This repository has been archived by the owner on Apr 5, 2023. It is now read-only.

Doesn't work with Webpack 4 #61

Closed
graycrow opened this issue Sep 14, 2018 · 13 comments
Closed

Doesn't work with Webpack 4 #61

graycrow opened this issue Sep 14, 2018 · 13 comments

Comments

@graycrow
Copy link

I downloaded the aut-webpack4-starter-kit and upgraded aurelia-toolbelt to version 1.1.1. As a result, now application throws few errors.

  1. Uncaught TypeError: Cannot read property 'get' of undefined at

    let loader: Loader = <Loader>container.get(Loader);

  2. Unhandled rejection Error: Unable to find module with ID: aurelia-toolbelt/external-resources/css/toastr.css

If I limit the plugin registration to specific component (like .plugin(PLATFORM.moduleName("aurelia-toolbelt/components/bootstrap/dropdown"))), then it starts to complain about missing html files, for example Unhandled rejection Error: Unable to find module with ID: aurelia-toolbelt/components/bootstrap/dropdown/abt-dropdown.html

@shahabganji
Copy link
Contributor

I will update related repositories within the next few days, I really was so busy this week to add the new feature, however if you are a .Net developer, may I ask you to check it with AureliaToolbelt.AspNetCore spa template?

dotnet new aut

@graycrow
Copy link
Author

Ok, with AureliaToolbelt.AspNetCore version 1.0.1-beta and .NET Core 2.1 issue 1 is gone but issue 2 still exists: Unhandled rejection Error: Unable to find module with ID: aurelia-toolbelt/external-resources/css/toastr.css

@shahabganji
Copy link
Contributor

May I ask you to use version 1 ?
Sorry I’m on mobile and cannot check them.

@graycrow
Copy link
Author

Tested with 1.0.0, the results are the same as with 1.0.1-beta.

@ghiscoding
Copy link

ghiscoding commented Sep 14, 2018

The WebPack starter still uses extract-text-webpack-plugin, however when I tried the new Angular-CLI, I had to switch to the new mini-css-extract-plugin for my project to work properly. I didn't try the starter kit, so I can't say this is really the problem, but if you want to give it a try, you can follow these steps that I've put on the Aurelia-CLI issue, the CLI now uses it.

Also as a side note, I tried the webpack 4 starter kit couple weeks ago and also coudn't get it to run. However when I installed Aurelia-Toolbelt withing my working WebPack 4 project (with the new mini-css-extract-plugin), everything is working fine and is using the new version of this lib to 1.1.1 . So I would suggest to maybe do a new project from scratch using Aurelia-CLI and install latest Aurelia-Toolbelt and it will most probably work. Or try to follow the instruction I wrote in the Aurelia-CLI issue to change to mini-css-extract-plugin.

Hope that helps

@shahabganji
Copy link
Contributor

@graycrow

Thanks for your support, anyway, the problem you mentioned is a known issue 🙈 😄 for our library and its due totally to this line. As @ghiscoding said, it pertains to how CSS loaders work, that's not a blocking issue though, and the library works seamlessly 🤞 . I should remove the above-mentioned line and release a new package. Hence, I need more time to create some repositories from scratch with the @ghiscoding 's suggestions.

@shahabganji
Copy link
Contributor

@graycrow, @ghiscoding

Hi, I have updated aurelia-toolbelt to v1.2.1 and respectively the dotnet template ( dotnet new --install AureliaToolbelt.AspNetCore::1.2.1 ) and webpack starter kit, I checked them and they look errorless. Can you guys do me a favor and make a double check?

@ghiscoding
Copy link

I probably won't have time to try this out until next weekend. But so far I can say that from the entire set of component, I am not able to make the aurelia-dialog working, so the recent changes in your Modal demo doesn't work for me. However this is probably not in your .Net demo.

@shahabganji
Copy link
Contributor

@ghiscoding

I tested again the modal sample in dotnet Template, which uses webpack rather than fusebox and I got no error, it would be great if you could upload a repo and reproduce your problem.

modal

@ghiscoding
Copy link

@shahabganji
I tried the webpack starter kit and I'm getting an error. However I'm not sure how to star the project. Is it just npm start? If so, this is what I'm getting

C:\aut-webpack4-starter-kit\node_modules\webpack-cli\bin\config-yargs.js:89
                                describe: optionsSchema.definitions.output.properties.path.description,
                                                                           ^

TypeError: Cannot read property 'properties' of undefined
    at module.exports (C:\aut-webpack4-starter-kit\node_modules\webpack-cli\bin\config-yargs.js:89:48)
    at Object.<anonymous> (C:\aut-webpack4-starter-kit\node_modules\webpack-dev-server\bin\webpack-dev-server.js:84:40)
    at Module._compile (internal/modules/cjs/loader.js:654:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10)
    at Module.load (internal/modules/cjs/loader.js:566:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
    at Function.Module._load (internal/modules/cjs/loader.js:498:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:695:10)
    at startup (internal/bootstrap/node.js:201:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:516:3)
The script called "webpack.server" which runs "webpack-dev-server -d --devtool '#source-map' --inline --env.server" failed with
exit code 1 https://github.com/kentcdodds/nps/blob/v5.9.3/other/ERRORS_AND_WARNINGS.md#failed-with-exit-code
The script called "webpack" which runs "nps webpack.server" failed with exit code 1 https://github.com/kentcdodds/nps/blob/v5.9.3/other/ERRORS_AND_WARNINGS.md#failed-with-exit-code
The script called "default" which runs "nps webpack" failed with exit code 1 https://github.com/kentcdodds/nps/blob/v5.9.3/other/ERRORS_AND_WARNINGS.md#failed-with-exit-code
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! aut-starter-kit-webpack@0.1.0 start: `nps`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the aut-starter-kit-webpack@0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

I didn't try the other repo since I don't think that I have .Net Core installed anymore

@shahabganji
Copy link
Contributor

@ghiscoding

I always use au run --watch, however in your case I tried npm start and that worked too, I got no error. have you tried yarn install before running the project?

npm

npm2

npm3

@ghiscoding
Copy link

ghiscoding commented Oct 6, 2018

I tried a few things and still can't run it. I just got recent aurelia-cli version 0.35.1 too. I have Gulp and aurelia-cli installed globally but that is all. Also I'm on Windows, so I'm not sure if that is the problem. Anyhow, I won't spend more time on this. The best would be to hear about @graycrow and see if it works for him.

EDIT
I tried running a brand new project from aurelia-cli and I actually have the same kind of errors with old & new verson of the CLI. So I'm not sure what my problem is but it's probably not your repo per say

EDIT 2
I found my problem, I have another app taking port 8080 and didn't noticed earlier that new Aurelia project also take the same port. It all works now. I will have to try to add aurelia-dialog to it and see if it works there. As for aurelia-toolbelt with WebPack 4, it seems all good ( I only tried webpack starter kit though)... Thanks

@shahabganji
Copy link
Contributor

@ghiscoding

Thanks for your patience and support, let's keep our fingers crossed 🤞

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants