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

Bundle ES(flagsmith-es) and combine with standard CJS module (flagsmith) #226

Closed
kyle-ssg opened this issue Apr 24, 2024 · 4 comments · Fixed by #280
Closed

Bundle ES(flagsmith-es) and combine with standard CJS module (flagsmith) #226

kyle-ssg opened this issue Apr 24, 2024 · 4 comments · Fixed by #280
Assignees
Labels
good first issue Good for newcomers

Comments

@kyle-ssg
Copy link
Member

kyle-ssg commented Apr 24, 2024

At the moment, users who wish to use our es module need to install flagsmith-es. We should combine the modules together.

Doing this will also solve an issue with SvelteKit + OpenFeature, since Svelte expects es modules and OpenFeature comes bundled with flagsmith which is throwing errors expecting flagsmith to be a module.

I can't seem to figure out how to do this at the moment but it will involve adjusting rollup and instructing package.json on how to deal with this e.g.

"main": "dist/cjs/index.js",
"module": "dist/mjs/index.js",
"exports": {
    ".": {
        "import": "./dist/mjs/index.js",
        "require": "./dist/cjs/index.js"
    }
},
@kyle-ssg kyle-ssg added the good first issue Good for newcomers label Apr 24, 2024
@kyle-ssg kyle-ssg linked a pull request Jan 14, 2025 that will close this issue
4 tasks
@kyle-ssg
Copy link
Member Author

This is now published under flagsmith version 9.0.0! 🚀

@nightire
Copy link

Unfortunately it doesn't works (with Typescript 5.3.3):

Image

@tiagoapolo
Copy link
Contributor

@nightire can you try https://github.com/Flagsmith/flagsmith-js-client/releases/tag/9.0.1 and let me know if fixes for you?

@nightire
Copy link

@tiagoapolo The main module and the react module are working fine. However, the isomorphic and next-middleware modules do not have the .d.ts files included.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants