Currently I'm getting the below error from trying to import some files as strings into my main.ts.
main.ts:2:21 - error TS2307: Cannot find module './shaders/vertex.glsl' or its corresponding type declarations. main.ts:3:21 - error TS2307: Cannot find module './shaders/fragment.glsl' or its corresponding type declarations. main.ts:
// shader import vsource from ".shaders/vertex.glsl"; import fsource from ".shaders/fragment.glsl"; typings/glsl.d.ts:
declare module "*.glsl" { const value: string; export default value; } tsconfig:
{ "compilerOptions": { /* Visit https://aka.ms/tsconfig.json to read more about this file */ /* Basic Options */ "target": "es5", "lib": [ "es2019", "dom" ] , "allowJs": false, "declaration": true, "sourceMap": true, "outDir": "./dist/", "strict": true, "noImplicitAny": true, "strictNullChecks": true, "strictFunctionTypes": true, "strictBindCallApply": true, "strictPropertyInitialization": true, "noImplicitThis": true, "alwaysStrict": true, "noUnusedLocals": false, "noUnusedParameters": false, "noImplicitReturns": true, "noFallthroughCasesInSwitch": true , "typeRoots": [ "./typings" ], "allowSyntheticDefaultImports": true, "esModuleInterop": true, "skipLibCheck": true, "forceConsistentCasingInFileNames": true }, "compileOnSave": true, "include": ["main.ts"] } my folder structure:
Does anyone know why this error is occurring and how I can fix it?
https://stackoverflow.com/questions/66147162/error-ts2307-cannot-find-module-shaders-vertex-glsl-or-its-corresponding-typ February 11, 2021 at 08:33AM
没有评论:
发表评论