ray
ray
DTDrizzle Team
Created by ray on 6/15/2023 in #help
require() of ES Module not supported
not that i remember
27 replies
DTDrizzle Team
Created by ray on 6/15/2023 in #help
require() of ES Module not supported
i believe for my project it was necessary, but you have to change a couple of your configs
27 replies
DTDrizzle Team
Created by ray on 6/15/2023 in #help
require() of ES Module not supported
yup
27 replies
DTDrizzle Team
Created by ray on 6/15/2023 in #help
require() of ES Module not supported
i got it to work by copying someone from the internet's tsconfig file:
{
"ts-node": {
"esm": true,
"experimentalSpecifierResolution": "node"
},
"compilerOptions": {
"target": "es2016",
"module": "ESNext",
"moduleResolution": "node",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true
},
"include": [
"./**/*"
],
"exclude": [
"node_modules",
]
}
{
"ts-node": {
"esm": true,
"experimentalSpecifierResolution": "node"
},
"compilerOptions": {
"target": "es2016",
"module": "ESNext",
"moduleResolution": "node",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true
},
"include": [
"./**/*"
],
"exclude": [
"node_modules",
]
}
i also added "type": "module" to my package.json file. i'm honestly not too sure what in the file did the trick, but i was so fed up with that bug that i just moved on 😂
27 replies
DTDrizzle Team
Created by ray on 6/15/2023 in #help
require() of ES Module not supported
Here's my package.json file:
{
"name": "drizzle-express",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"dev": "nodemon src/index.ts"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"@planetscale/database": "^1.7.0",
"@types/react": "18.2.8",
"@types/react-dom": "18.2.4",
"autoprefixer": "10.4.14",
"dotenv": "^16.1.4",
"drizzle-orm": "^0.26.5",
"eslint": "8.42.0",
"eslint-config-next": "13.4.4",
"express": "^4.18.2",
"nodemon": "^2.0.22",
"postcss": "8.4.24",
"react": "18.2.0",
"react-dom": "18.2.0",
"tailwindcss": "3.3.2",
"undici": "^5.22.1"
},
"devDependencies": {
"@types/express": "^4.17.17",
"@types/node": "^20.3.1",
"drizzle-kit": "^0.18.1",
"esbuild-register": "^3.4.2",
"ts-node": "^10.9.1",
"typescript": "^5.1.3"
}
}
{
"name": "drizzle-express",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"dev": "nodemon src/index.ts"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"@planetscale/database": "^1.7.0",
"@types/react": "18.2.8",
"@types/react-dom": "18.2.4",
"autoprefixer": "10.4.14",
"dotenv": "^16.1.4",
"drizzle-orm": "^0.26.5",
"eslint": "8.42.0",
"eslint-config-next": "13.4.4",
"express": "^4.18.2",
"nodemon": "^2.0.22",
"postcss": "8.4.24",
"react": "18.2.0",
"react-dom": "18.2.0",
"tailwindcss": "3.3.2",
"undici": "^5.22.1"
},
"devDependencies": {
"@types/express": "^4.17.17",
"@types/node": "^20.3.1",
"drizzle-kit": "^0.18.1",
"esbuild-register": "^3.4.2",
"ts-node": "^10.9.1",
"typescript": "^5.1.3"
}
}
27 replies