Comments (7)
I can't start you repo because I can't install @ngx-tmp/bug-repo
. NPM says it is not found
from ng-universal.
Thanks so much for taking a look at this. I've updated the nest application repository ( nest-mikro-bug ) to use the paths config in the tsconfig.json rather than the private npm repository I was using. You will need to do the following:
- get the updated nest-mikro-bug code - it will update the tsconfig.json and the package.json
- npm install
- switch to nest-mikro-bug-lib and build it->
ng build @ngx-tmp/bug-repo
- update the tsconfig.json for nest-mikro-bug to point to your output (in case your workspace has a different name than mine). You need to change this line - tsconfig.json#L22
- run
nest start
to start up nest
from ng-universal.
I tried something new. I built with nest, but than did the following:
- installed module-alias so I could more clearly specify which bundle I wanted to use
- ran using "node dist/main.js"
I was careful to use the umd module as this document says it is the format to use for node.js. The result was:
$ node dist/main.js
C:\Users\joelw\eclipse-workspace\tower-poi\packages\ngx-tmp\dist\ngx-tmp\bug-rep
o\bundles\ngx-tmp-bug-repo.umd.js:411
var _this = _super.apply(this, __spreadArray([], __read(argument
s))) || this;
^
TypeError: Class constructor Type cannot be invoked without 'new'
at new TransformType (C:\Users\joelw\eclipse-workspace\tower-poi\packages\ng
x-tmp\dist\ngx-tmp\bug-repo\bundles\ngx-tmp-bug-repo.umd.js:411:29)
at Function.TransformType.newTransform (C:\Users\joelw\eclipse-workspace\tow
er-poi\packages\ngx-tmp\dist\ngx-tmp\bug-repo\bundles\ngx-tmp-bug-repo.umd.js:41
6:19)
Not sure if it helps much but it is something new. Here's some context around line 411
var TransformType = /** @class */ (function (_super) {
__extends(TransformType, _super);
function TransformType() {
var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
_this.options = {};
return _this;
}
from ng-universal.
I made a bit of progress. It seems nestjs was including the umd build from angular package. When I explicitly set the only build to be the esm2015 build in the package.json, nestjs was able to properly load the package at runtime.
//Went from this
{
"name": "@ngx-tmp/bug-repo",
"version": "0.0.1",
"license": "UNLICENSED",
"peerDependencies": {
"@mikro-orm/core": "^5.1.3"
},
"dependencies": {
"tslib": "^2.3.0"
},
"main": "bundles/ngx-tmp-bug-repo.umd.js",
"module": "fesm2015/ngx-tmp-bug-repo.js",
"es2015": "fesm2015/ngx-tmp-bug-repo.js",
"esm2015": "esm2015/ngx-tmp-bug-repo.js",
"fesm2015": "fesm2015/ngx-tmp-bug-repo.js",
"typings": "ngx-tmp-bug-repo.d.ts",
"sideEffects": false
}
// to this where I updated "main" to point to esm2015
{
"name": "@ngx-tmp/bug-repo",
"version": "0.0.1",
"license": "UNLICENSED",
"peerDependencies": {
"@mikro-orm/core": "^5.1.3"
},
"dependencies": {
"tslib": "^2.3.0"
},
"main": "esm2015/ngx-tmp-bug-repo.js",
"module": "fesm2015/ngx-tmp-bug-repo.js",
"es2015": "fesm2015/ngx-tmp-bug-repo.js",
"esm2015": "esm2015/ngx-tmp-bug-repo.js",
"fesm2015": "fesm2015/ngx-tmp-bug-repo.js",
"typings": "ngx-tmp-bug-repo.d.ts",
"sideEffects": false
}
Is there a way to somehow tell nestjs which target build to use in the package.json rather than having to manually update items in the node_modules folder?
from ng-universal.
That generally should be something that typescript is determining, and how node
is running, not anything specific to Nest
from ng-universal.
Yes, now that I've gone a bit deeper, I can see that you are right. Two possible solutions are:
- figuring out some way for angular to get angular to set "main" to the esm2015 build in the package.json
- figuring out some way to get nest to use the "esm2015" build instead of "main" from the package.json
For (1), I've looked and I don't see any easy way to do it. I probably have to create a post build script. Do you have any ideas on how to do (2)?
Feel free to close this issue if you have no ideas where to go from here. I was hoping you might know something about the nest build process such that I can either override the module import target or possible set which angular target to use.
from ng-universal.
from ng-universal.
Related Issues (20)
- Add support for Angular 16 HOT 1
- Missing domino dependency HOT 1
- Vulnerable reason to stay here with ^0.13.1 and not ^0.14.0 HOT 1
- errorHandler does not includes the request to be able to respond something.
- Prerender with standalone application don't work HOT 1
- Nestjs ng-universal package dependency errors HOT 6
- Support in Angular 17 HOT 6
- @nestjs/ng-universal not working with Angular 13 - Error [ERR_REQUIRE_ESM]: require() of ES Module HOT 4
- Angular 13 + ng add @nestjs/ng-universal --force (Package installed failed) HOT 2
- Can't resolve 'class-transformer/storage' HOT 2
- `npm run dev:ssr` fails to run on MacOS HOT 2
- Please make cache methods asynchronous HOT 1
- That package not work HOT 1
- minimal app with "Error: Module parse failed" HOT 2
- Would really love to use this library with latest major nestjs version (v9) HOT 1
- [FR] Add community maintainers to this package HOT 3
- Collection "@nestjs/ng-universal" cannot be resolved HOT 1
- Angular 15 ng add dependency issue 'Packages installation failed' HOT 6
- Can't start or build server application 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 ng-universal.