seth
seth
Explore posts from servers
NNuxt
Created by seth on 3/29/2025 in #❓・help
Future-proof way to disable auto-imports of ~/shared?
Hi there, I'm writing new code in Nuxt 3, and I noticed this note on https://nuxt.com/docs/guide/directory-structure/shared#auto-imports:
Auto-imports are not enabled by default in Nuxt v3 to prevent breaking changes in existing projects.To use these auto-imported utils and types, you must first set future.compatibilityVersion: 4 in your nuxt.config.ts.
Auto-imports are not enabled by default in Nuxt v3 to prevent breaking changes in existing projects.To use these auto-imported utils and types, you must first set future.compatibilityVersion: 4 in your nuxt.config.ts.
I'm writing code in ~/shared where multiple-files will export the same name, because they are alternate implementations of the same interface. I want to be explicit in my client+server code about which file is imported in all cases. I realize this will work on Nuxt 3, but I don't want to use a pattern that will apparently just break on Nuxt 4. Is there a way to mark specific files as "do not auto-import from this file"? Or a different recommended approach?
15 replies
DTDrizzle Team
Created by seth on 3/15/2025 in #help
Stack trace on constraint failed doesn't include my application code
I'm just getting started using drizzle on a new app, with sqlite and nuxt 3. Everything has been great, but there's one thing happening that really concerns me: when I generate an insert that fails a NOT NULL constraint, I get an error, but the stack trace doesn't include my application code. This is worrying me, because how would I find the issue if my app was large? Is it normal for drizzle stack traces to not include the calling function in the stack trace? If not, any suggestions how I go about fixing this? Example: because my code is small, I know this error was generated by server/utils/drizzle.ts at line 80 in the function selectOrCreateSession:
ERROR undefined Application error: NOT NULL constraint failed: universal_sessions.userID

at Object.next (node_modules/libsql/index.js:335:20)
at Statement.all (node_modules/libsql/index.js:360:16)
at executeStmt (node_modules/@libsql/client/lib-esm/sqlite3.js:261:34)
at Sqlite3Client.execute (node_modules/@libsql/client/lib-esm/sqlite3.js:79:16)
at LibSQLPreparedQuery.values (node_modules/src/libsql/session.ts:262:57)
at LibSQLPreparedQuery.all (node_modules/src/libsql/session.ts:191:27)
at QueryPromise.all (node_modules/src/sqlite-core/query-builders/insert.ts:396:26)
at QueryPromise.execute (node_modules/src/sqlite-core/query-builders/insert.ts:408:40)
at QueryPromise.then (node_modules/src/query-promise.ts:31:15)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)

// END OF STACK TRACE :-( Where is `at selectOrCreateSession (server/utils/drizzle.ts)` ???
ERROR undefined Application error: NOT NULL constraint failed: universal_sessions.userID

at Object.next (node_modules/libsql/index.js:335:20)
at Statement.all (node_modules/libsql/index.js:360:16)
at executeStmt (node_modules/@libsql/client/lib-esm/sqlite3.js:261:34)
at Sqlite3Client.execute (node_modules/@libsql/client/lib-esm/sqlite3.js:79:16)
at LibSQLPreparedQuery.values (node_modules/src/libsql/session.ts:262:57)
at LibSQLPreparedQuery.all (node_modules/src/libsql/session.ts:191:27)
at QueryPromise.all (node_modules/src/sqlite-core/query-builders/insert.ts:396:26)
at QueryPromise.execute (node_modules/src/sqlite-core/query-builders/insert.ts:408:40)
at QueryPromise.then (node_modules/src/query-promise.ts:31:15)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)

// END OF STACK TRACE :-( Where is `at selectOrCreateSession (server/utils/drizzle.ts)` ???
Is this expected? How would I debug this if I end up with a LARGE drizzle app? I've tried starting nuxt with: NODE_OPTIONS='--trace-uncaught' nuxt dev, because yeah, general node issue, but no luck.
11 replies