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

ng init --mobile flag breaks builds #2679

Closed
ferdis opened this issue Oct 13, 2016 · 6 comments · Fixed by #2753
Closed

ng init --mobile flag breaks builds #2679

ferdis opened this issue Oct 13, 2016 · 6 comments · Fixed by #2753
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent type: bug/fix

Comments

@ferdis
Copy link

ferdis commented Oct 13, 2016

OS?

OSX El Capitan

Versions.

angular-cli: 1.0.0-beta.17
node: 6.3.0
os: darwin x64

Repro steps.

$ ng init --mobile=true
$ ng serve

The log given by the failure.

Unexpected token import
./src/main-app-shell.ts:1
(function (exports, require, module, __filename, __dirname) { import 'angular2-universal-polyfills';
                                                              ^^^^^^
SyntaxError: Unexpected token import
    at Object.exports.runInThisContext (vm.js:76:16)
    at Module._compile (module.js:513:28)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Function.Module._load (module.js:409:3)
    at Module.require (module.js:468:17)
    at require (internal/module.js:20:19)
    at new PrerenderWebpackPlugin (./node_modules/angular-cli/utilities/prerender-webpack-plugin.js:8:27)
    at Object.exports.getWebpackMobileConfigPartial (./node_modules/angular-cli/models/webpack-build-mobile.js:20:13)
    at new NgCliWebpackConfig (./node_modules/angular-cli/models/webpack-config.js:21:42)
    at Class.exports.default.Task.extend.run (./node_modules/angular-cli/tasks/serve-webpack.js:19:22)
    at ./node_modules/angular-cli/commands/serve.js:85:26
    at process._tickCallback (internal/process/next_tick.js:103:

Mention any other details that might be useful.

This works fine without the --mobile flag.

@deebloo
Copy link
Contributor

deebloo commented Oct 13, 2016

I don't believe the --mobile flag is enabled currently.

https://github.com/angular/angular-cli#support-for-offline-applications

@ferdis
Copy link
Author

ferdis commented Oct 13, 2016

Oh okay, I didn't see that. I found the option with ng --help and tried it out.

Edit: Wait, it absolute is enabled though. It creates various files and icons.

@deebloo
Copy link
Contributor

deebloo commented Oct 13, 2016

@uitgewis I don't think it should be. I do know it is not currently supported

@ferdis
Copy link
Author

ferdis commented Oct 13, 2016

All good. I suggest adding the same error seen here(https://github.com/angular/angular-cli/blob/master/packages/angular-cli/commands/new.ts#L58) to the init command as well.

I can PR if in agreement?

@filipesilva
Copy link
Contributor

@uitgewis I'd appreciate a PR for that, yes!

@filipesilva filipesilva added type: bug/fix command: new P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent labels Oct 14, 2016
hollannikas added a commit to hollannikas/angular-cli that referenced this issue Oct 17, 2016
Show error message when user uses the mobile flag in conjunction with the init command.

Fix angular#2679
hollannikas added a commit to hollannikas/angular-cli that referenced this issue Oct 17, 2016
Show error message when user uses the mobile flag in conjunction with the init command.

Closes angular#2679
filipesilva pushed a commit that referenced this issue Oct 17, 2016
Show error message when user uses the mobile flag in conjunction with the init command.

Closes #2679
Brocco pushed a commit that referenced this issue Oct 19, 2016
Show error message when user uses the mobile flag in conjunction with the init command.

Closes #2679
kieronqtran pushed a commit to kieronqtran/angular-cli that referenced this issue Oct 21, 2016
Show error message when user uses the mobile flag in conjunction with the init command.

Closes angular#2679
texel pushed a commit to splice/angular-cli that referenced this issue Nov 3, 2016
Show error message when user uses the mobile flag in conjunction with the init command.

Closes angular#2679
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent type: bug/fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants