Comments (5)
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.
Thanks @mbellish we'll look into this and get back to you.
from flagsmith-js-client.
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.
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.
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)
- Case sensitive flags are lower cased when trying to retrieve values
- isLoading never updates to false if flag is disabled (React useFlagsmith hook) HOT 5
- Clear cache when calling logout() HOT 5
- the value obtained is sometimes not appropriate HOT 2
- Don't call getFlags() if the identity set is the same HOT 6
- error TS2304: Cannot find name 'bool'
- Provide explicit setter functions for Data Dog / Dynatrace HOT 1
- Improve useFlagsmithLoading
- Cannot read properties of null (reading 'getValue') HOT 4
- isLoading never updates to false HOT 2
- Flagsmith's `loadingState.error` is not respect actual error state HOT 11
- [Bug] - NextJS >= 13.0.0 SSR `useFlagsmith` state not matching the state that is passed to the provider. HOT 16
- flagsmith/react only works in React 18 HOT 3
- [Bug] - TypeError: Cannot read properties of null (reading 'getValue') HOT 5
- Flagsmith's 'useFlags' doesn't return actual cached flags when request failed HOT 2
- Inconsistent license information HOT 2
- Caching with multiple instance doesn't work HOT 6
- Typing issue in react.tsx: 'flagsmith' is possibly 'null' HOT 3
- useFlags() race condition HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flagsmith-js-client.