Comments (25)
"module": "commonjs" have to be set in source code of linq-es2015 before build.
If you want quick fix, you can change linq.js (and the same way other js files) in lib folder:
(function (factory) { if (typeof module === 'object' && typeof module.exports === 'object') { var v = factory(exports); if (v !== undefined) module.exports = v; } else if (typeof define === 'function' && define.amd) { define(["require", "exports", "./generators", "./utilities", "./iterators"], factory); } })(function (exports) {
(remove require from function parameters)
from linq.
Your description of the problem does not make any sense to me. What module, where failing, why webpack and how is it being used? Would you care to provide more context, perhaps even code sample...
from linq.
I have cleaned up the chaotic question, hope its more clear now.
from linq.
Have you looked at this example?
https://github.com/ENikS/LINQ/tree/examples/Angular
Can you create a repo and upload your project there so I can look at it?
from linq.
Yes I had a quick look at that link but then I saw its for systemJS which I do not use. For sure I will create a repo on github where I put the minimum stuff to get you going :-)
from linq.
https://github.com/bastienJS/linqmoduletest
Do
- 'npm install' to install locally all node modules.
- 'npm start' :-)
- See the error in the console output
from linq.
Will have to do some research...
from linq.
Hello Eugene, any news on that feature request? I have birthday on 20th october ;-)
from linq.
It could be fixed by changing module in tsconfig.json from umd to commonjs.
from linq.
My setting was on ES6 and I tried to commonjs: "module": "commonjs",
but I get the same error message! although the exception happens now in mainbundle.js file not linqjs file:
here:
'''
var v = factory(!(function webpackMissingModule() { var e = new Error("Cannot find module ".""); e.code = 'MODULE_NOT_FOUND'; throw e; }()), exports); if (v !== undefined) module.exports = v;
'''
Great linq might work but my application does not start anymore haha ;-)
from linq.
@Vito2102 Why don`t you make a pull request for this? That would be great!
from linq.
I do not think manual change of compiled files constitutes a good solution. I am researching AMD loader as solution but unfortunately don't have enough time for it.
from linq.
@ENikS Why you use in configuration module: umd and not module: commonjs?
from linq.
In Node it is configured as UMD (tsconfig.json) and compiled into lib dir. Browserified UMD module is compiled into ./dist directory to be used in UI. I am still trying to understand why webpack is not picking up at least one of these.
UMD should be digestible by both Node and Browser. I have feeling it is simply not finding it.
from linq.
@bastienJS Could you try to remove this line from angular-cli.json:
"scripts": ["../node_modules/linq-es2015/dist/linq.js"],
and try to run it again?
Or perhaps change it into:
"scripts": ["../node_modules/linq-es2015/lib/linq.js"],
from linq.
If you compile lib as commonjs, you don't need to add to angular-cli.json and it is working in angular cli.
from linq.
I just have some problem with uglify, when build as production.
from linq.
With "scripts": [],
I can see linq-2015 is imported alone with angular-core in main.bandle.js
:
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_linq_es2015__ = __webpack_require__(587);
...
I am unable to verify it on the browser at the moment but as far as processing by Webpack I see no issues.
from linq.
You tried it with angular cli?
from linq.
https://github.com/ENikS/linqmoduletest
https://ide.c9.io/eniks/webpack-cloned
https://preview.c9users.io/eniks/webpack-cloned
from linq.
I've pushed latest to the repo. You should be able to check out and test.
from linq.
@ENikS To the https://github.com/ENikS/linqmoduletest Repo ? If yes all I see there is that you removed the scripts Array content. I did that long before on my local app but I get the same exception during runtime: can not find module . in lin.js Or do I miss something?
from linq.
It seems that Webpack only understands commonjs modules. Perhaps there are ways to load UMD modules as well but I did not find it. So I changed module type to commonjs and it fixed the problem.
from linq.
When I change the tsconfig.ts => module: 'commonjs' then it works only with your linq-es2015 version 2.4.12 but not with 2.4.10 ??? I thought you have not changed anything concerning this feature? As I miss a changelog with versions I can not easily check what has changed, but maybe you know... thanks for investigating.
from linq.
Yes, I fixed it in 2.4.12 so the lest should work with the Webpack
from linq.
Related Issues (20)
- Unexpected token: name (CSharpEnumerator) HOT 16
- GroupBy object key failed. HOT 7
- Left join Faild HOT 5
- An in-range update of typescript is breaking the build 🚨
- OrderBy ThenBy Not work as Expect HOT 3
- F#
- Crash after reusing enumerable HOT 2
- Custom providers or only collections HOT 6
- Concat() element duplicate. HOT 2
- GroupBy typing incorrect HOT 7
- can't call methods on IGrouping HOT 9
- GroupBy overload with result selector has wrong signature.
- TypeError: g.Single is not a function
- SelectMany(). the index of grouped array HOT 3
- Aggregate Bug HOT 4
- Making EnumerableImpl [[call]]able HOT 1
- GroupBy Date Bug? HOT 1
- Missing production files version 2.4.35 HOT 1
- GroupBy doesn't work if key is empty string or null HOT 4
- Sorting using ThenBy or ThenByDescending in a chain is not immutable as in C# HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from linq.