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

Importing a non-existing import should fail compilation #1213

Closed
cramforce opened this issue Dec 21, 2015 · 8 comments · Fixed by #13312
Closed

Importing a non-existing import should fail compilation #1213

cramforce opened this issue Dec 21, 2015 · 8 comments · Fixed by #13312

Comments

@cramforce
Copy link
Member

Or at least a separate check.

I assume this is not failing with babel because of per-file compilation, but possibly we can add an extra check.

CC @erwinmombay

@erwinmombay
Copy link
Member

weird, i think this would currently fail. will double check.

@erwinmombay erwinmombay self-assigned this Dec 21, 2015
@ericlindley-g ericlindley-g added this to the M2 milestone Feb 6, 2016
@rudygalfi rudygalfi modified the milestones: M2, Backlog Mar 4, 2016
@adelinamart
Copy link
Contributor

Is this still relevant?

@adelinamart
Copy link
Contributor

@erwinmombay @mrjoro to provide updates here. Thanks

@ampprojectbot
Copy link
Member

This issue hasn't been updated in awhile. @erwinmombay Do you have any updates?

@rsimha rsimha assigned rsimha and unassigned erwinmombay Jan 31, 2018
@rsimha
Copy link
Contributor

rsimha commented Feb 2, 2018

I just tested this with:

const foo = require('foo');
import {bar} from './bar';

It turns out that we print a Cannot find module error, and then proceed with the build. @cramforce shall we make this a fatal error that stops the build?

@cramforce
Copy link
Member Author

cramforce commented Feb 2, 2018 via email

@rsimha
Copy link
Contributor

rsimha commented Feb 5, 2018

This is now fixed. Here's what you will see.

Syntax error:

SyntaxError: amphtml/src/foo.js: Unexpected token (20:6)
  18 | 
  19 | if (foo) {
> 20 |   bar(;
     |       ^
  21 | }
  22 | 

Other errors, like bad imports:

Error: Cannot find module './bar' from 'amphtml/src/foo'

@rsimha
Copy link
Contributor

rsimha commented Feb 6, 2018

Reopening because we shouldn't cancel watch when an edit causes a compilation error.

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

Successfully merging a pull request may close this issue.

8 participants