I am trying to use @react-three/drei and I've got this error after upgrading to nextjs 13:
**./node_modules/three-stdlib/nodes/ShaderNode.js Module parse failed: Export 'float' is not defined (468:340) File was processed with these loaders:
- ./node_modules/next/dist/compiled/@next/react-refresh-utils/dist/loader.js
- ./node_modules/next/dist/build/webpack/loaders/next-swc-loader.js You may need an additional loader to handle the result of these loaders. | var EPSILON = _float2(1e-6); | var INFINITY = _float2(1e6);
export { EPSILON, INFINITY, ShaderNode, abs, acos, add, addTo, alphaTest, and, asin, assign, atan, attribute, bitAnd, bitOr, bitXor, bmat3, bmat4, bool1 as bool, buffer, bvec2, bvec3, bvec4, cameraPosition, ceil, clamp, color, cond, cos, cross, dFdx, dFdy, degrees, diffuseColor, distance, div, dot, element, equal, exp, exp2, faceforward, float, floor, fract, greaterThan, greaterThanEqual, imat3, imat4, int, inversesqrt, invert, ivec2, ivec3, ivec4, join, label, length, lessThan, lessThanEqual, log, log2, mat3, mat4, max, metalness, min, mix, mod, mul, negate, nodeObject, normalGeometry, normalLocal, normalView, normalWorld, normalize, or, positionLocal, positionView, positionViewDirection, positionWorld, pow, pow2, pow3, pow4, radians, reflect, refract, remainder, roughness, round, sampler, saturate, shiftLeft, shiftRight, sign, sin, smoothstep, specularColor, sqrt, step, sub, tan, temp, texture, transformDirection, transformedNormalView, uint1 as uint, umat3, umat4, uniform, uv, uvec2, uvec3, uvec4, vec2, vec3, vec4, viewMatrix, xor }; | var _c, _c1, _c2, _c3, _c4; | $RefreshReg$(_c, "ShaderNodeObject");**
my environment is like this:
"next": "^13.0.4",
"react": "^18.2.0",
"three": "^0.146.0",
"three-stdlib": "^2.19.0",
"@react-three/drei": "^9.41.3",
"@react-three/fiber": "^8.9.1",
Please help me
I tried to use @react-three/drei in next js 13 and react 18 and I've got this error: Module parse failed: Export 'float' is not defined