I'm submitting a ... (check one with "x")
Getting an error while running ng serve.
Current behavior:
Running ng serve fails compilation with error: ERROR in node_modules/@nebular/theme/components/layout/layout.module.d.ts(1,22): error TS-996002: Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule class
Expected behavior:
ng serve should work without any errors.
Steps to reproduce:
ng new --enable-ivy --inline-style --inline-template --style=scss -v --directory=admin Adminng add @nebular/themeng servenpm, node, OS, Browser
Same behaviour on Windows 10 and macOS Mojave
Angular, Nebular
Angular: 8.0.0, Nebular: 4.0.0
Hi @Napas, the only thing I can say here is that we haven't tested Nebular with Ivy yet. If you have a chance to dig in so that we can provide some workaround or fix something in Nebular, that would be great.
I am not even able to install it.
Following is the error when I run npm i
D:\nodebook\nebular>npm i
npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but npm-shrinkwrap.json was generated for lockfileVersion@0. I'll try to do my best with it!
> [email protected] install D:\nodebook\nebular\node_modules\weak
> node-gyp rebuild
D:\nodebook\nebular\node_modules\weak>if not defined npm_config_node_gyp (node "C:\Users\sandeepkumar.g\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Users\sandeepkumar.g\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
weakref.cc
win_delay_load_hook.cc
d:\nodebook\nebular\node_modules\weak\src\weakref.cc(147): error C2660: 'v8::Function::Call': function does not take 3
arguments [D:\nodebook\nebular\node_modules\weak\build\weakref.vcxproj]
c:\users\sandeepkumar.g\.node-gyp\12.4.0\include\node\v8.h(4148): note: see declaration of 'v8::Function::Call' (comp
iling source file ..\src\weakref.cc)
d:\nodebook\nebular\node_modules\weak\src\weakref.cc(168): error C2660: 'v8::ObjectTemplate::NewInstance': function doe
s not take 0 arguments [D:\nodebook\nebular\node_modules\weak\build\weakref.vcxproj]
c:\users\sandeepkumar.g\.node-gyp\12.4.0\include\node\v8.h(6244): note: see declaration of 'v8::ObjectTemplate::NewIn
stance' (compiling source file ..\src\weakref.cc)
d:\nodebook\nebular\node_modules\weak\src\weakref.cc(223): error C2039: 'IsNearDeath': is not a member of 'Nan::Persist
ent<v8::Object,v8::NonCopyablePersistentTraits<T>>' [D:\nodebook\nebular\node_modules\weak\build\weakref.vcxproj]
with
[
T=v8::Object
]
d:\nodebook\nebular\node_modules\nan\nan.h(1920): note: see declaration of 'Nan::Persistent<v8::Object,v8::NonCopyabl
ePersistentTraits<T>>'
with
[
T=v8::Object
]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Users\sandeepkumar.g\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:200:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\sandeepkumar.g\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd D:\nodebook\nebular\node_modules\weak
gyp ERR! node -v v12.4.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
> [email protected] postinstall D:\nodebook\nebular
> npm-run-all -p cli:firefox-fix build:dev-schematics
> [email protected] cli:firefox-fix D:\nodebook\nebular
> rimraf node_modules/@angular-devkit/build-angular/node_modules/uglify-es && rimraf node_modules/@angular-devkit/build-angular/node_modules/uglifyjs-webpack-plugin
> [email protected] build:dev-schematics D:\nodebook\nebular
> rimraf ./schematics/dist && gulp build-development-schematics
D:\nodebook\nebular\node_modules\natives\index.js:143
fn(internalBinding)(nm.exports, cachingRequire, nm, nm.filename, '<no dirname available>')
^
ReferenceError: primordials is not defined
at fs.js:27:26
at req_ (D:\nodebook\nebular\node_modules\natives\index.js:143:24)
at Object.req [as require] (D:\nodebook\nebular\node_modules\natives\index.js:55:10)
at Object.<anonymous> (D:\nodebook\nebular\node_modules\vinyl-fs\node_modules\graceful-fs\fs.js:1:37)
at Module._compile (internal/modules/cjs/loader.js:774:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:785:10)
at Module.load (internal/modules/cjs/loader.js:641:32)
at Function.Module._load (internal/modules/cjs/loader.js:556:12)
at Module.require (internal/modules/cjs/loader.js:681:19)
at require (internal/modules/cjs/helpers.js:16:16)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build:dev-schematics: `rimraf ./schematics/dist && gulp build-development-schematics`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build:dev-schematics script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\sandeepkumar.g\AppData\Roaming\npm-cache\_logs\2019-06-14T07_50_00_979Z-debug.log
ERROR: "build:dev-schematics" exited with 1.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `npm-run-all -p cli:firefox-fix build:dev-schematics`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\sandeepkumar.g\AppData\Roaming\npm-cache\_logs\2019-06-14T07_50_01_045Z-debug.logD:\nodebook\nebular>npm i
npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but npm-shrinkwrap.json was generated for lockfileVersion@0. I'll try to do my best with it!
> [email protected] install D:\nodebook\nebular\node_modules\weak
> node-gyp rebuild
D:\nodebook\nebular\node_modules\weak>if not defined npm_config_node_gyp (node "C:\Users\sandeepkumar.g\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Users\sandeepkumar.g\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
weakref.cc
win_delay_load_hook.cc
d:\nodebook\nebular\node_modules\weak\src\weakref.cc(147): error C2660: 'v8::Function::Call': function does not take 3
arguments [D:\nodebook\nebular\node_modules\weak\build\weakref.vcxproj]
c:\users\sandeepkumar.g\.node-gyp\12.4.0\include\node\v8.h(4148): note: see declaration of 'v8::Function::Call' (comp
iling source file ..\src\weakref.cc)
d:\nodebook\nebular\node_modules\weak\src\weakref.cc(168): error C2660: 'v8::ObjectTemplate::NewInstance': function doe
s not take 0 arguments [D:\nodebook\nebular\node_modules\weak\build\weakref.vcxproj]
c:\users\sandeepkumar.g\.node-gyp\12.4.0\include\node\v8.h(6244): note: see declaration of 'v8::ObjectTemplate::NewIn
stance' (compiling source file ..\src\weakref.cc)
d:\nodebook\nebular\node_modules\weak\src\weakref.cc(223): error C2039: 'IsNearDeath': is not a member of 'Nan::Persist
ent<v8::Object,v8::NonCopyablePersistentTraits<T>>' [D:\nodebook\nebular\node_modules\weak\build\weakref.vcxproj]
with
[
T=v8::Object
]
d:\nodebook\nebular\node_modules\nan\nan.h(1920): note: see declaration of 'Nan::Persistent<v8::Object,v8::NonCopyabl
ePersistentTraits<T>>'
with
[
T=v8::Object
]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Users\sandeepkumar.g\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:200:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\sandeepkumar.g\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd D:\nodebook\nebular\node_modules\weak
gyp ERR! node -v v12.4.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
> [email protected] postinstall D:\nodebook\nebular
> npm-run-all -p cli:firefox-fix build:dev-schematics
> [email protected] cli:firefox-fix D:\nodebook\nebular
> rimraf node_modules/@angular-devkit/build-angular/node_modules/uglify-es && rimraf node_modules/@angular-devkit/build-angular/node_modules/uglifyjs-webpack-plugin
> [email protected] build:dev-schematics D:\nodebook\nebular
> rimraf ./schematics/dist && gulp build-development-schematics
D:\nodebook\nebular\node_modules\natives\index.js:143
fn(internalBinding)(nm.exports, cachingRequire, nm, nm.filename, '<no dirname available>')
^
ReferenceError: primordials is not defined
at fs.js:27:26
at req_ (D:\nodebook\nebular\node_modules\natives\index.js:143:24)
at Object.req [as require] (D:\nodebook\nebular\node_modules\natives\index.js:55:10)
at Object.<anonymous> (D:\nodebook\nebular\node_modules\vinyl-fs\node_modules\graceful-fs\fs.js:1:37)
at Module._compile (internal/modules/cjs/loader.js:774:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:785:10)
at Module.load (internal/modules/cjs/loader.js:641:32)
at Function.Module._load (internal/modules/cjs/loader.js:556:12)
at Module.require (internal/modules/cjs/loader.js:681:19)
at require (internal/modules/cjs/helpers.js:16:16)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build:dev-schematics: `rimraf ./schematics/dist && gulp build-development-schematics`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build:dev-schematics script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\sandeepkumar.g\AppData\Roaming\npm-cache\_logs\2019-06-14T07_50_00_979Z-debug.log
ERROR: "build:dev-schematics" exited with 1.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `npm-run-all -p cli:firefox-fix build:dev-schematics`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\sandeepkumar.g\AppData\Roaming\npm-cache\_logs\2019-06-14T07_50_01_045Z-debug.log
Angular CLI: 8.0.0
Node: 12.4.0
OS: win32 x64
Angular: 8.0.0
... animations, cdk, cli, common, compiler, compiler-cli, core
... forms, language-service, platform-browser
... platform-browser-dynamic, router
@angular-devkit/architect 0.800.0
@angular-devkit/build-angular 0.800.0
@angular-devkit/build-optimizer 0.800.0
@angular-devkit/build-webpack 0.800.0
@angular-devkit/core 8.0.0
@angular-devkit/schematics 8.0.0
@ngtools/webpack 8.0.0
@schematics/angular 8.0.0-rc.4
@schematics/update 0.800.0
rxjs 6.5.2
typescript 3.4.5
webpack 4.30.0
@nnixaa I've ended up not using Ivy, so it's not an issue for me anymore, but overall that needs to be fixed as Ivy will be released quite soon.
I believe this could be similar
https://github.com/angular/angular/issues/30972
I realize ivy is not necessarily something that is official, but certainly digging into this may help get nebular ready by the time ivy is officially supported, and not just preview opt-in
Along the lines of the comments in the end of the linked thread, I upgraded project to latest angular preview 8.2.0-next.1 and it got rid of the errors in the original issue.
It now seems like ivy fails trying to import @nebular/eva-icons
ERROR in Node does not exist: C:/source/nebulartest/node_modules/@nebular/eva-icons
This issue still happen in version 8.2.0-next.2

Any progress on this?
Still the same with 8.2.9 and nebular 4.3.1. Ivy seems to have some requirements on the packaging of the nebular modules.
same with 8.2.11 and nebular 4.4.0.
It works with ivy now, so we should close this i think
Most helpful comment
This issue still happen in version 8.2.0-next.2
