I encountered a typescript error while building my NEXT JS application. The error message was: Type error: Cannot find module '!raw-loader!@types/lodash/common/array.d.ts'
Below is the content of my tsConfig.json file:
{
"compilerOptions": {
"paths": {
"@components/*": [
"./src/*"
]
},
"lib": [
"dom",
"dom.iterable",
"esnext"
],
// Other compiler options...
},
// Include and exclude settings...
}
Also, here's the raw-loader.d.ts file I'm using:
declare module 'raw-loader!*' {
const contents: string
export default contents
}
Note: I do not have a webpack.config.js file in my setup.
In addition, I am utilizing the @monaco-editor/react package in my project, which includes the following component code:
'use client';
import Editor, { useMonaco } from '@monaco-editor/react';
import LODASH_array from '!raw-loader!@types/lodash/common/array.d.ts';
// Other imports...
export default MyComponent() {
// Component logic...
}