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

Wilcard imports cause runtime ReferenceError #526

Closed
1 task done
camwiegert opened this issue Feb 12, 2018 · 0 comments
Closed
1 task done

Wilcard imports cause runtime ReferenceError #526

camwiegert opened this issue Feb 12, 2018 · 0 comments
Assignees

Comments

@camwiegert
Copy link
Contributor

Stencil version:

 @stencil/core@0.4.3

I'm submitting a:

  • bug report

Current behavior:

When importing a module from a component using wildcard syntax:

import * as someModule from './some-module';

@Component({
  tag: 'my-component'
})
export class MyComponent {

And using the import somehow in the render method:

render() {
  return <div>{ someModule.someProp }</div>;
}

I get a runtime error: ReferenceError: someModule is not defined.

Expected behavior:

The module should be bundled with the component? Would wildcard imports break code splitting? Using named imports works as expected:

import { someProp } from './some-module';

Steps to reproduce:

I've reproduced in this repo.

@adamdbradley adamdbradley added this to the 0.6.0 - Puppeteer milestone Feb 13, 2018
@jthoms1 jthoms1 modified the milestones: 0.6.0 - Puppeteer, 0.5.0 - Custom Plugins Feb 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants