I have created a reproduction repository at this link: https://github.com/mspoulsen/zod-error. You can find all my settings there.
When I try to compile the project using npx webpack
, I encounter errors.
The desired outcome is to compile without any errors.
Current behavior:
ERROR in ./node_modules/zod/lib/src/index.js 7:15-40
Module not found: Error: Can't resolve './types/string' in '/home/morten/code/mspoulsen/zod-error/node_modules/zod/lib/src'
@ ./src/index.ts 22:21-35
ERROR in ./node_modules/zod/lib/src/index.js 9:15-40
Module not found: Error: Can't resolve './types/number' in '/home/morten/code/mspoulsen/zod-error/node_modules/zod/lib/src'
@ ./src/index.ts 22:21-35
ERROR in ./node_modules/zod/lib/src/index.js 11:15-40
Module not found: Error: Can't resolve './types/bigint' in '/home/morten/code/mspoulsen/zod-error/node_modules/zod/lib/src'
@ ./src/index.ts 22:21-35
I am unsure if this error lies in the zod library or if it's due to something missing in my webpack or typescript configuration.
Here is an overview of my tsconfig:
{
"compilerOptions": {
/* Visit https://aka.ms/tsconfig.json to read more about this file */
/* Basic Options */
// Configuration options omitted for brevity
/* Strict Type-Checking Options */
"strict": true /* Enable all strict type-checking options. */,
// More options are available, but not included for simplicity
/* Module Resolution Options */
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */,
// More resolution options exist but excluded here for clarity
/* Advanced Options */
"skipLibCheck": true /* Skip type checking of declaration files. */,
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
},
"include": ["src"],
"exclude": ["node_modules"]
}
I would greatly appreciate any assistance with this issue :)