-
-
Notifications
You must be signed in to change notification settings - Fork 35
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
Uncaught Error: Cannot find module './aurelia-framework'. #30
Comments
I had the same issue. I didn't realize/verify that it was specificially the aurelia-webpack-plugin package that was the culprit though, so I reverted everything to target the previous versions and it at least got my project running again. I am on Windows as well, and am working in a project that was based off of the aurelia-skeleton-navigation base from about 2 months ago (with modifications as needed, of course). A teammate had the same issue though, and he is running in Mac. |
@m-andrew-albright without more insight to your friends setup I'm unable to track the issue. He seems to be the only one on OS X to experience this problem though. Could you please ask him about more details like logs from running |
His setup is exactly the same as mine, except he's running in Mac. We are both in the same project. It was based off of the aurelia-skeleton-navigation, I don't know what version, but it was downloaded around May 10th I believe. |
I get the same issue. Our project structure is a little different though. Our projects look like:
When we run App, it looks at the dependencies just fine, but it doesn't go further and look at that dependency's dependencies, which means it can't find aurelia.
to all of our projects? This is a lot of maintenance to keep this updated... Also, if bootstrapper has a plugin or component, then I need to update resources to include |
I'm on OS X and I had the same problem (as the subject line) with the latest (1.2.6) skeleton framework es2016 webpack I made the suggested change from: "aurelia-webpack-plugin": "^1.0.0-beta.1.0.0", and it works fine now NOTE: I forgot to remove the ^ from the original line the first time -- without that crucial bit the change doesn't help !! |
@MRHayato build resources should be all elements that are dynamically required by Aurelia. You don't need to put things that Aurelia doesn't directly use and therefore shouldn't be a lot of maintenance. If you use your own aurelia-plugins or custom bootstrappers, just add a similar section of dependencies inside of those plugins/bootstrappers, then just add the plugin name as a resource -- the rest should be handled by the plugin. If it isn't it's a bug of the plugin and we'll fix it. @m-andrew-albright We know for sure that Linux / OS X should work without a hitch (we even put automated tests in the recent days for that). So while Windows support is still untested and has known bugs, skeleton should be working under OS X or Linux - as is. @ajoslin103 please paste output of |
@niieani I think I can live with that. What about the recursive aspect of our folder structure? Our aurelia dependencies are quite far down our chain of modules, and isn't getting found by the webpack plugin. |
I got that package.json from a download of skeleton-navigation-1.0.0-beta.1.2.6.zip on the page: https://github.com/aurelia/skeleton-navigation/releases -- I just unzipped it again to check... I would like to learn how to base my project on a git clone of the current skeleton so that I can pull updates I'll try cloning and see how that works |
@MRHayato Aurelia's build dependencies, as long as they are defined (as build resources) in the module declared as a resource, will load their resources recursively. In simpler terms: aurelia's build resources work recursively. Also note that they are unrelated to npm To make it even clearer: Most of the time you won't need to define any extra build resources. They're only needed for very special circumstances such as plugins or external ValueConverters or BindingBehaviors. In fact, we're planning on removing all the resources defined by default in the skeleton as they'll be migrated into their respectful dependencies (so that: @ajoslin103 Indeed, that release is old and was made with the old webpack plugin. The new chances haven't yet been officially released, but you may try them out by git cloning the current skeleton. |
@niieani How do I clone just the webpack esnext ? Is that possible ? |
@ajoslin103 No, I've merged the typescript and esnext webpack skeleton into one now -- you will be asked to choose the language upon |
I guess I meant: is it possible to clone just the skeleton-webpack (and, that's ok -- I don't either...) but I see from a little googling that it's easier not to do that. I cloned the whole skeleton-navigation and copied out the skeleton-webpack then ran npm install and then npm run server -- and it's working just fine 1st try (I chose Javascript) I can't thank you enough for your work on aurelia and webpack -- it's all just so stellar !! I just came off 2.5 years of Angular 1x and Aurelia is such a breath of fresh and clean air !! |
To get a real error at compile time, change to awesome-typescript-loader instead of ts-loader in webpack. It breaks early when this error occurs, while ts-loader finishes the bundle as an invalid code, so you don't see it's faulty until run-time
This is the problem caused by aurelia-webpack-plugin@1.0.0-beta.2.0.0 |
I experienced this same issue today. I touched something, either an |
@y2k4life - clone the actual github project and pull out the folder skeleton-webpack folder I found that version to work without any mods -- it asks if you want TS or JS at the end of the initial npm install, (use npm run server instead of npm run dev.) As a further bonus, that version includes an .eslintrc all setup for the aurelia framework, which is working great w/Atom's linter for me! |
Perhaps I wasn't clear about this, but it sounds like you're referring to the latest skeleton released; we based our project on the skeleton that was available when we started it a month or two ago, and it has been working/upgrading just fine until yesterday. So while the new skeleton may in fact work perfectly in Mac, upgrading the old skeleton's packages breaks it completely whether you are in Windows or Mac. Downloading the new skeleton and then re-porting over all our code, packages, and configuration seems like a hefty endeavor. I am hoping that is not the recommended path to upgrade. Thanks for addressing the issue with us here; I haven't seen any Aurelia team members respond to the several people asking about it in the gitter, but we have found the work around at least (without being able to point to the newest version unfortunately) |
@m-andrew-albright It's not possible to upgrade the webpack-plugin to beta-2.0.0 without updating the However I see that the version range used in the previously released webpack skeleton was
As for Gitter: we try to respond there, but since there's a lot of noise in the messages, it's really hard to read and respond to everybody. Its best to report any real issue here, on GitHub issues. If you have a Webpack specific issue and want to chat, feel free to mention me on Gitter by writing: @niieani. |
FWIW: here are the non-trivial results from npm install on OS X on a freshly cloned [8:40am] skeleton-webpack ( npm --version 3.9.0, node --version v6.2.0 ) answering Javascript for language (I'd be more than happy to repeat this process for you, or any other on OS X at any time if it is of some benefit to you.)
|
@ajoslin103 These warning messages can be safely ignored. They'll disappear once the dependencies update their peer-dependency version ranges. |
The reason this is all such a pain point is because the numbering system is 1.0.0-betaX.X.X, so as far as NPM is concerned, we're always sticking to version 1.0 with minor updates (accepted by the |
@jsobell You are correct, I have mentioned the non-semver problem in the above comment. Fortunately v1.0 is around the corner so I don't think we'll need to change numbering. However I'll try to mitigate the issue by releasing the next version of webpack-plugin that'll be backwards compatible with 1.0.4. |
I'm having issues with the aurelia-webpack-plugin 1.0.0-beta.2.0.0. It can't find any modules. I believe this problem is somehow related to aurelia/skeleton-navigation#497. The plugin is trying to find the modules inside the src folder then I get the error
Cannot find module ./aurelia-framework
. In addition, it seems to happen only on Windows (not sure, I just heard about it).EDIT: based on the comments it's not happening only on Windows...
For now, I'm using the previous release, 1.0.0-beta.1.0.4, which works fine. I'm investigating this issue and I'll let you know if I find more information.
For those who are looking for a solution:
The temporary solution is downgrading aurelia-webpack-plugin. To do this, in your package.json, change the aurelia-webpack-plugin version to "1.0.0-beta.1.0.4"`. Make sure the module and version are this "aurelia-webpack-plugin": "1.0.0-beta.1.0.4" not only the version but also make sure the version did not have the ^ prefix.
Then run
npm install
The text was updated successfully, but these errors were encountered: