-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
TypeScript import warnings when building (causes "exports is not defined") #3145
Comments
Since you can't provide a reproduction and no access to the original project, there's little we can do. I'll mark this as "help wanted", maybe someone already came across this and can help out? |
Possible related: webpack/webpack#2977 (comment) & webpack/webpack#7378 |
I'm also experiencing the same issue and it looks like it's an unsolved problem with issues reaching back to early '16, and touching various project incl. |
I get this as well when importing a bunch of interfaces from one file. It looks like some people wrote some plugins to silence some of these warnings as a workaround in TypeStrong/ts-loader#653 (comment) for example, but I couldn't get it to work with my I still get warnings like this:
|
Having the same issue, also across multiple projects. Would love to see a solution here. |
The same issue. I'll be happy if someone fix this bug) |
Are there any solutions or workarounds for this? One that I have thought of is using import {ActionMethod} from 'vuex';
@Component
export default class Comp extends Vue {
@namespace('stuff').Action('fetch') private readonly fetchStuff!: ActionMethod; I get warnings like But if I do import type {ActionMethod} from 'vuex';
@Component
export default class Comp extends Vue {
@namespace('stuff').Action('fetch') private readonly fetchStuff!: ActionMethod; I do not get a warning in the build anymore. However, now I get an eslint error Is there any way to stop these warnings but also keep Second Question: Is this a bug in webpack, vue, or typescript-eslint? (related to typescript-eslint/typescript-eslint#2972) |
The following solution worked for me does not work import { IAmureDragEvent, IAmureLayoutMetadata } from '@/core/AmureLayout.interface' solution import type { IAmureDragEvent, IAmureLayoutMetadata } from '@/core/AmureLayout.interface' -- P.S. I have no problem with -- |
Version
3.2.0
Environment info
Steps to reproduce
I have tried time and time again to create a minimal reproduction of this issue and I have failed. It just seems to happen when a project gets beyond a certain size.
What is expected?
The project to build without warnings.
What is actually happening?
The project builds with warnings:
This bug has been plaguing me for many months now, and on multiple projects, but I have had a workaround - I have simply deleted the node_modules folder before each build and it seemed to fix the issue. This no longer seems to work.
Even though the project builds, the resulting output does not work, with the following error displayed in the browser console:
exports is not defined
. This has been consistent throughout the time I've had this issue.. on the occasions I did get it to compile, this error did not exist. This makes me think it may be a babel issue, but I really can't tell.Some other notes:
npm run serve
works fine."emitDecoratorMetadata": true
, but I don't have that in my config,My
tsconfig.json
:The text was updated successfully, but these errors were encountered: