-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Carousel Unexpected Import with Angular Universal #3073
Comments
Could you create a minimal reproduction of this? Sample repo would be enough. |
Hi, I have a repo that you can check the Dev Branch is the updated one. |
Have you added all necessary files like |
I made a separate repo for the build one |
you can see there the server.js and package.json, it is currently working because I temporarily removed the Banner carousel. |
Hi @IlyaSurmay hope you can help me make it work.. I added a new branch "build" where the dist folder with the bundle files, server.js and package.json is available https://github.com/jezguitarist30/AngularPH-Universal-Application/tree/build |
@jezguitarist30 issue is kinda simple, node.js doesn't support es6 |
OH! I see, thanks for the explanation I wouldn't be able to figure this out myself. |
@valorkin hi, Thanks for the info. Could you explain a bit more how to compile node_modules in es5? I couldn't find a way to do that? |
@denizcoskun you can check https://github.com/angular/angular-cli/wiki/stories-universal-rendering for a complete guide on how to do that, I just followed all the steps here and mine is now working. |
@jezguitarist30 thanks! |
Below is the error I get when I run my server.js, everything works well when I removed my component that uses Carousel.
D:\Development\DemoProjects\angularph-universal-app\node_modules\ngx-bootstrap\carousel\slide.component.js:1
(function (exports, require, module, __filename, __dirname) { import { Component, HostBinding, Input } from '@angular/core';
^^^^^^
SyntaxError: Unexpected token import
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:542:28)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.mK+S (D:\Development\DemoProjects\angularph-universal-app\dist\server\main.ac013103ccc455daa776.bundle.js:1:132178)
PS D:\Development\DemoProjects\angularph-universal-app>
The text was updated successfully, but these errors were encountered: