Skip to content

Conversation

levrik
Copy link

@levrik levrik commented Aug 8, 2025

These were present in @types/mixpanel-browser before but got lost when inlining them. I originally introduced them in the external types through DefinitelyTyped/DefinitelyTyped#72165.

Fixes #501

These were present in `@types/mixpanel-browser` before but got lost when inlining them
@jakewski
Copy link
Contributor

Hey thanks for the contribution!

If I'm understanding correctly, the use case here is to be able to import the pre-built bundles like import mixpanel from 'mixpanel-browser/dist/mixpanel-core' and the types are not applied? Also, does this PR build the files in dist or were they manually added? Everything in dist/ is generated code so just making sure npm run build-dist doesn't override all of your changes here.

@federicobond
Copy link

If I'm understanding correctly, the use case here is to be able to import the pre-built bundles like import mixpanel from 'mixpanel-browser/dist/mixpanel-core' and the types are not applied?

This is correct. It's currently preventing me (and likely others) from updating to the latest version of the mixpanel library.

@@ -0,0 +1 @@
export * from '../src/index';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code isn't going to be copied into dist/ as part of the build process (your current branch will have this change overridden when running npm run build-dist). I think the easiest way would be to add additional entrypoints in package.json like

mixpanel-js/package.json

Lines 27 to 31 in 012f1ee

"./src/loaders/loader-module-core": {
"types": "./src/index.d.ts",
"import": "./src/loaders/loader-module-core.js",
"require": "./src/loaders/loader-module-core.js"
},
- or updating rollup config to generate these type files

Copy link
Author

@levrik levrik Sep 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. I opened this PR before you introduced the exports in package.json. I'll try to revisit this asap.
Actually these pre-built files aren't even accessible due to the introduction of exports anymore atm, not only the typings are missing.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can take this over if you can't get it to it, apologies for the trouble. Since we made these custom builds we said in our docs to import the non-built loaders (e.g. src/loaders/loader-module-core) because I thought that would be preferable.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be great if you could handle it. I would close this PR then.

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

Successfully merging this pull request may close these issues.

loader-module-core type error in 2.67.0
3 participants