Skip to content

Using Next.js base path causes application to crash #6

@squk

Description

@squk

To reproduce, replace next.config.js with the following:

module.exports = {
  basePath: '$DATA_DICTIONARY_BASE_PATH',
  typescript: {
    ignoreBuildErrors: true
  },
  serverRuntimeConfig: {
    PROJECT_ROOT: __dirname
  }
}

where DATA_DICTIONARY_BASE_PATH is a relative path like /dictionary.

Visiting localhost:3000 results in the following error:

yarn run v1.22.5
$ next dev
Loaded env from /app/.env
ready - started server on 0.0.0.0:3000, url: http://localhost:3000
event - compiled successfully
Attention: Next.js now collects completely anonymous telemetry regarding usage.
This information is used to shape Next.js' roadmap and prioritize features.
You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
https://nextjs.org/telemetry

event - build page: /
wait  - compiling...
event - compiled successfully
Warning: Each child in a list should have a unique "key" prop.

Check the top-level render call using <tr>. See https://reactjs.org/link/warning-keys for more information.
    at th
    at Table (webpack-internal:///./components/table.tsx:23:51)
    at div
    at DataModels (webpack-internal:///./pages/index.tsx:59:61)
    at div
    at Home
    at main
    at div
    at div
    at Layout (webpack-internal:///./components/layout.tsx:188:3)
    at StoreProvider (/app/node_modules/easy-peasy/dist/index.cjs.js:1662:23)
    at MyApp (webpack-internal:///./pages/_app.tsx:29:3)
    at AppContainer (/app/node_modules/next/dist/next-server/server/render.js:25:874)
event - build page: /api/graphql
wait  - compiling...
event - compiled successfully

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions