Skip to content
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

not working with universal #9

Closed
Gorniv opened this issue Aug 23, 2017 · 7 comments
Closed

not working with universal #9

Gorniv opened this issue Aug 23, 2017 · 7 comments
Assignees
Labels

Comments

@Gorniv
Copy link

Gorniv commented Aug 23, 2017

I dont can run universal app with 'ts-node' and 'angular-async-local-storage'
source app: https://github.com/gorniv/universal/tree/material

/Users/Gorniv/GitHub/universal/UniApp/node_modules/angular-async-local-storage/src/async-local-storage.js:1
(function (exports, require, module, __filename, __dirname) { import { Injectable } from '@angular/core';
                                                              ^^^^^^

SyntaxError: Unexpected token import
    at createScript (vm.js:74:10)
    at Object.runInThisContext (vm.js:116:10)
    at Module._compile (module.js:537:28)
    at Object.Module._extensions..js (module.js:584:10)
    at Module.load (module.js:507:32)
    at tryModuleLoad (module.js:470:12)
    at Function.Module._load (module.js:462:3)
    at Module.require (module.js:517:17)
    at require (internal/module.js:11:18)
    at Object.angular-async-local-storage/src/async-local-storage (/Users/Gorniv/GitHub/universal/UniApp/dist-server/main.462f910c364768b8c046.bundle.js:4079:18)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! universal-demo@0.0.0 uad: `ng build --dev --output-hashing=all --aot=true && ng build --aot=true --output-hashing=all --dev --app 1 && ts-node server`
@cyrilletuzi cyrilletuzi self-assigned this Aug 23, 2017
@cyrilletuzi
Copy link
Owner

It's a known issue for all third party librairies : angular/angular-cli#7200

Currently, to work with Universal via the CLI, even if they are Universal-compatible, librairies have to be packaged in a very specific way, and the Angular team hasn't published clear instructions about this yet.

The CLI should solve this issue in next releases.

@Gorniv
Copy link
Author

Gorniv commented Aug 23, 2017

thank you!

@glebmachine
Copy link

@cyrilletuzi how long it will be take?

@cyrilletuzi
Copy link
Owner

cyrilletuzi commented Aug 23, 2017

No idea, I'm not a member of the Angular team and unfortunately they are not very verbose about their work and plans.

But I may solve it by myself for this library in the next days, as I need it in another project.

@glebmachine
Copy link

Thank you!)

@cyrilletuzi
Copy link
Owner

Solution found, but I will only be able to fix this lib in 2 weeks.

@cyrilletuzi
Copy link
Owner

Fixed in last version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants