fix: strip .js extensions from SDK imports; restore turbopack dev

This commit is contained in:
thesn10
2026-06-25 18:39:14 +02:00
parent 5cc3231952
commit 627e08b192
6 changed files with 10 additions and 19 deletions

View File

@@ -3,15 +3,6 @@ import type { NextConfig } from 'next'
const config: NextConfig = { const config: NextConfig = {
reactStrictMode: true, reactStrictMode: true,
transpilePackages: ['@solana/connector', '@solisting/sdk', '@descro/sdk'], transpilePackages: ['@solana/connector', '@solisting/sdk', '@descro/sdk'],
webpack(webpackConfig) {
// Workspace SDK packages use .js extensions on TypeScript imports (ESM convention)
// but have no compiled output — webpack must resolve .js → .ts
webpackConfig.resolve.extensionAlias = {
'.js': ['.ts', '.tsx', '.js'],
'.mjs': ['.mts', '.mjs'],
}
return webpackConfig
},
} }
export default config export default config

View File

@@ -2,7 +2,7 @@
"name": "solisting-app", "name": "solisting-app",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "next dev", "dev": "next dev --turbopack",
"build": "next build", "build": "next build",
"start": "next start", "start": "next start",
"typecheck": "tsc --noEmit" "typecheck": "tsc --noEmit"

View File

@@ -1,13 +1,13 @@
// Generated bindings — accounts, instructions, pdas, types, errors, program id // Generated bindings — accounts, instructions, pdas, types, errors, program id
export * from './generated/solisting/src/generated/index.js' export * from './generated/solisting/src/generated/index'
// Hand-written helpers // Hand-written helpers
export * from './pda.js' export * from './pda'
export * from './listing.js' export * from './listing'
// Order exports are imported but we exclude the re-exported deriveEscrowId to avoid duplication // Order exports are imported but we exclude the re-exported deriveEscrowId to avoid duplication
// since it's already exported from pda.js // since it's already exported from pda.js
export type { OrderAccountWithPda } from './order.js' export type { OrderAccountWithPda } from './order'
export { fetchOrdersForListing, fetchOrdersByBuyer, fetchOrder } from './order.js' export { fetchOrdersForListing, fetchOrdersByBuyer, fetchOrder } from './order'
// Re-export Address for consumers // Re-export Address for consumers
export type { Address, Account } from '@solana/kit' export type { Address, Account } from '@solana/kit'

View File

@@ -7,7 +7,7 @@ import {
fetchSolistingStateListingAccount, fetchSolistingStateListingAccount,
SOLISTING_STATE_LISTING_ACCOUNT_DISCRIMINATOR, SOLISTING_STATE_LISTING_ACCOUNT_DISCRIMINATOR,
type SolistingStateListingAccount, type SolistingStateListingAccount,
} from './generated/solisting/src/generated/index.js' } from './generated/solisting/src/generated/index'
const PROGRAM_ADDRESS = address('DzwUAbpRvqcbA8QsEkRbZeXG4TEho5782cMySodrUHBU') const PROGRAM_ADDRESS = address('DzwUAbpRvqcbA8QsEkRbZeXG4TEho5782cMySodrUHBU')

View File

@@ -7,8 +7,8 @@ import {
fetchSolistingStateOrderAccount, fetchSolistingStateOrderAccount,
SOLISTING_STATE_ORDER_ACCOUNT_DISCRIMINATOR, SOLISTING_STATE_ORDER_ACCOUNT_DISCRIMINATOR,
type SolistingStateOrderAccount, type SolistingStateOrderAccount,
} from './generated/solisting/src/generated/index.js' } from './generated/solisting/src/generated/index'
import { deriveEscrowId } from './pda.js' import { deriveEscrowId } from './pda'
const PROGRAM_ADDRESS = address('DzwUAbpRvqcbA8QsEkRbZeXG4TEho5782cMySodrUHBU') const PROGRAM_ADDRESS = address('DzwUAbpRvqcbA8QsEkRbZeXG4TEho5782cMySodrUHBU')

View File

@@ -1,5 +1,5 @@
import { address, getAddressEncoder, type Address, type ProgramDerivedAddress } from '@solana/kit' import { address, getAddressEncoder, type Address, type ProgramDerivedAddress } from '@solana/kit'
import { findListingAccountPda, findOrderAccountPda } from './generated/solisting/src/generated/index.js' import { findListingAccountPda, findOrderAccountPda } from './generated/solisting/src/generated/index'
const PROGRAM_ADDRESS = address('DzwUAbpRvqcbA8QsEkRbZeXG4TEho5782cMySodrUHBU') const PROGRAM_ADDRESS = address('DzwUAbpRvqcbA8QsEkRbZeXG4TEho5782cMySodrUHBU')