Coder Social home page Coder Social logo

Rollup Name for react about flagsmith-js-client HOT 5 OPEN

mbellish avatar mbellish commented on August 22, 2024
Rollup Name for react

from flagsmith-js-client.

Comments (5)

cbix avatar cbix commented on August 22, 2024

Not sure if this is related, but I'm getting this webpack error:

ERROR in ./node_modules/flagsmith/src/react.tsx 16:70
Module parse failed: Unexpected token (16:70)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| import {IFlagsmith, IFlagsmithTrait, IFlagsmithFeature, IState} from './types'
| 
> export const FlagsmithContext = createContext<IFlagsmith<string,string> | null>(null)
| export type FlagsmithContextType = {
|     flagsmith: IFlagsmith // The flagsmith instance
 @ ./node_modules/flagsmith/react.js 1:78-94
 @ ./src/app/pages/Dashboard/index.tsx 14:0-64 44:18-26 60:25-44

This never happened before and I'm using lots of other typescript dependencies.

from flagsmith-js-client.

matthewelwell avatar matthewelwell commented on August 22, 2024

Thanks @mbellish we'll look into this and get back to you.

from flagsmith-js-client.

cbix avatar cbix commented on August 22, 2024

Regarding my webpack error, I found the issue is I had

modules: ['node_modules', 'src']

in my webpack config so webpack was looking at flagsmith/src for module resolution. This is fixed by changing it to

modules: ['node_modules', path.resolve(__dirname, '../../src')]

so only the desired src directory is considered.

from flagsmith-js-client.

novakzaballa avatar novakzaballa commented on August 22, 2024

Thank you for the update @cbix !
@mbellish is it possible that are having a similar issue? As a workaround to verify if this is the case you could also manually delete the src code in the node_modules/flasmith directory after install the packages or add this postinstall to your pacake.json scripts section:
"postinstall": "rm -rf ./node_modules/flagsmith/src"

from flagsmith-js-client.

mbellish avatar mbellish commented on August 22, 2024

It's a different situation. We have a number of modules which use a webpack configuration to build as a module, and in order to desginate this as an external library (not to be included in the compiled results). the "flagsmith/react" was problematic.

We ended up forking the codebase and changing the umd name from flagsmith/react to flagsmith-react in the rollup.config.ts line 165:
name:"flagsmith/react",

from flagsmith-js-client.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.