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

Cannot find module '@babel/polyfill' #6

Open
roddharris opened this issue Jun 18, 2019 · 6 comments
Open

Cannot find module '@babel/polyfill' #6

roddharris opened this issue Jun 18, 2019 · 6 comments

Comments

@roddharris
Copy link

roddharris commented Jun 18, 2019

I installed the latest version of the templates: dotnet new -i aurelia.dotnet.templates

I then created a new folder and within the folder did the following dotnet new aurelia

Once that was completed, I then did an npm install to ensure all my packages were loaded. I then ran the project (which should be a very basic Hello World) and I get an error stating that

Cannot find module '@babel/polyfill'

The error occurs during the webpack build of main.ts.

What do I need to do to get this working? I kind of figured the initial template would just work out of the box.

I also tried: au build and got the following

image

I tried npm install babel-polyfill but that didn't fix anything.

@alexdresko
Copy link

Interesting. I'm investigating a similar error I found, so I'm including my findings here in case it helps resolve both our issues.

Steps:

  1. npm install -g aurelia-cli
  2. cd (mkdir c:\code\test\au-wp) (Powershell)
  3. au new aurelia-app -u -s http2,dotnet-core,typescript,htmlmin-min,sass,vscode,scaffold-navigation
  4. cd aurelia-app
  5. npm install
  6. npx webpack webpack.config.js

The bundle tries to build, but I end up with a ton of errors similar to your "module not found: error: can't resolve...." error.

au build does work, though, and I believe that has something to do with how the aurelia build.ts task does a bunch of magic before manually invoking webpack.

For the record, I have not tried the dotnet new template, and, again, I'm not trying to hijack this thread. Just trying to hopefully add some relevant information.

@alexdresko
Copy link

I ended up creating aurelia/cli#1134 to track my issue.

@radenkozec
Copy link

@roddharris Have you solve the problem? I have exact same issue.

@roddharris
Copy link
Author

Unfortunately, I did not. I wound up using the Aurelia CLI to generate my code instead as found here.

@radenkozec
Copy link

I solve it by referencing @babel/polyfill and change in main.js to import '@babel/polyfill';

@roddharris
Copy link
Author

I just remembered one thing I did -- at least in one project. I removed the use of @babel/polyfill. (somewhere I read that that is not supposed to be used with aurelia anymore.) So, I npm uninstall @babel/polyfill then I npm install core-js@3 and add the following to main.js import 'core-js/stable'. Hope that helps.

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

3 participants