R
roblox-ts3mo ago
Pizza

Cant use react

{
"compilerOptions": {
// required
"allowSyntheticDefaultImports": true,
"downlevelIteration": true,
"jsx": "react",
"jsxFactory": "React.createElement",
"jsxFragmentFactory": "React.Fragment",
"module": "commonjs",
"moduleResolution": "Node",
"noLib": true,
"resolveJsonModule": true,
"forceConsistentCasingInFileNames": true,
"moduleDetection": "force",
"strict": true,
"target": "ESNext",
"typeRoots": ["node_modules/@rbxts", "node_modules/@flamework"],

// configurable
"rootDir": "src",
"outDir": "out",
"baseUrl": "src",
"incremental": true,
"tsBuildInfoFile": "out/tsconfig.tsbuildinfo",

"experimentalDecorators": true,
"plugins": [
{
"transform": "rbxts-transformer-flamework",
"obfuscation": false
}
]
}
}
{
"compilerOptions": {
// required
"allowSyntheticDefaultImports": true,
"downlevelIteration": true,
"jsx": "react",
"jsxFactory": "React.createElement",
"jsxFragmentFactory": "React.Fragment",
"module": "commonjs",
"moduleResolution": "Node",
"noLib": true,
"resolveJsonModule": true,
"forceConsistentCasingInFileNames": true,
"moduleDetection": "force",
"strict": true,
"target": "ESNext",
"typeRoots": ["node_modules/@rbxts", "node_modules/@flamework"],

// configurable
"rootDir": "src",
"outDir": "out",
"baseUrl": "src",
"incremental": true,
"tsBuildInfoFile": "out/tsconfig.tsbuildinfo",

"experimentalDecorators": true,
"plugins": [
{
"transform": "rbxts-transformer-flamework",
"obfuscation": false
}
]
}
}
{
"name": "flamework-template",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"build": "rbxtsc",
"watch": "rbxtsc -w"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"@rbxts/compiler-types": "^2.3.0-types.1",
"@rbxts/types": "^1.0.777",
"@typescript-eslint/eslint-plugin": "^6.7.5",
"@typescript-eslint/parser": "^6.7.5",
"eslint": "^7.31.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-roblox-ts": "^0.0.30",
"prettier": "^2.3.2",
"rbxts-transformer-flamework": "^1.2.2",
"roblox-ts": "^2.3.0",
"typescript": "~5.2.2"
},
"dependencies": {
"@flamework/components": "^1.2.2",
"@flamework/core": "^1.2.2",
"@flamework/networking": "^1.2.2",
"@rbxts/document-service": "^1.2.2-ts.1",
"@rbxts/react": "^17.2.3",
"@rbxts/react-roblox": "^17.2.3",
"@rbxts/roact": "^3.0.1"
}
}
{
"name": "flamework-template",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"build": "rbxtsc",
"watch": "rbxtsc -w"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"@rbxts/compiler-types": "^2.3.0-types.1",
"@rbxts/types": "^1.0.777",
"@typescript-eslint/eslint-plugin": "^6.7.5",
"@typescript-eslint/parser": "^6.7.5",
"eslint": "^7.31.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-roblox-ts": "^0.0.30",
"prettier": "^2.3.2",
"rbxts-transformer-flamework": "^1.2.2",
"roblox-ts": "^2.3.0",
"typescript": "~5.2.2"
},
"dependencies": {
"@flamework/components": "^1.2.2",
"@flamework/core": "^1.2.2",
"@flamework/networking": "^1.2.2",
"@rbxts/document-service": "^1.2.2-ts.1",
"@rbxts/react": "^17.2.3",
"@rbxts/react-roblox": "^17.2.3",
"@rbxts/roact": "^3.0.1"
}
}
Solution:
anyways, your roblox-ts is outdated. update it using npm i roblox-ts@latest
Jump to solution
5 Replies
Pizza
PizzaOP3mo ago
heres my tsconfig and package.json im getting this error error TS2304: Cannot find name 'Roact'.
wAD
wAD3mo ago
hey you should've pinged me !
Solution
wAD
wAD3mo ago
anyways, your roblox-ts is outdated. update it using npm i roblox-ts@latest
wAD
wAD3mo ago
or, a next build which supports spread destructuring npm i roblox-ts@next (which might be useful since you use react !)
Pizza
PizzaOP3mo ago
ok thanks i think that was the problem i was using the flamework template so i guess i forgot to upgrade

Did you find this page helpful?