Skip to content

Issue with webpack2 #3320

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

Closed
gjuchault opened this issue Nov 30, 2016 · 11 comments
Closed

Issue with webpack2 #3320

gjuchault opened this issue Nov 30, 2016 · 11 comments
Labels
needs: investigation Requires some digging to determine if action is needed P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@gjuchault
Copy link

gjuchault commented Nov 30, 2016

OS?

macOs Sierra

Versions.

angular-cli: 1.0.0-beta.21
node: 7.1.0
os: darwin x64

I guess the bug comes from webpack2 that now understands import/export. I have a shared folder with a lot of services, and I import them inside my app.module.ts:

app/shared/logger/logger.ts:

export enum Level { OFF = 0, ERROR = 1, WARN = 2, INFO = 3, DEBUG = 4, LOG = 5 }

app/shared/logger/index.ts:

export * from './logger.service';
export * from './level';

app/shared/index.ts

export * from './logger';
// ... other services

app/app.module.ts:

import {
  // ... other services
  LoggerService,
  Level
} from './shared';

console.log(Level); // undefined

If I change the last line to console.log(Level, require('./shared').Level); they both get printed

@clydin
Copy link
Member

clydin commented Nov 30, 2016

Is there an index.ts in the animation directory?

@gjuchault
Copy link
Author

Indeed, I added it to the post

@clydin
Copy link
Member

clydin commented Dec 1, 2016

the only thing that's exported is 'reflow'.

@gjuchault
Copy link
Author

I fixed all code examples sorry

@clydin
Copy link
Member

clydin commented Dec 2, 2016

Does it only happen with the enum? I remember reading about an issue regarding exports and enums but don't remember where I saw it.

@gjuchault
Copy link
Author

It's with everything I export with * somehow

@gjuchault
Copy link
Author

gjuchault commented Dec 5, 2016

Weird thing: if I console.log(module.exports) inside app/shared/logger/index.ts, I get this:

log

@filipesilva
Copy link
Contributor

I wonder if this is related to ngc as well. Needs some investigation.

@filipesilva filipesilva added command: build needs: investigation Requires some digging to determine if action is needed P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent labels Dec 30, 2016
@gjuchault
Copy link
Author

I'm not using ngc or I did nothing to do so. Maybe that is related to typescript handling of export * ?

@filipesilva
Copy link
Contributor

Closing as outdated, please let me know if you still experience this error. Might also be related to #2741.

@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 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs: investigation Requires some digging to determine if action is needed P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

No branches or pull requests

3 participants