Skip to content

create-rescript-app produces broken configuration for Next.js if rescript 12 is used #117

Closed

Description

@Raffinate

Steps to reproduce

  1. npx create rescript-app@latest
  2. | What is the name of your new ReScript project?
    | resexample
  3. | Select a template
    | Next.js
  4. | ReScript version?
    | 12.2.0
  5. cd resexample
  6. head -n 30 README.md

...

Development

Run ReScript in dev mode:
npm run res:dev
In another tab, run the Next dev server:
npm run dev

  1. Open 2 terminal tabs and navigate to the project directory
  2. In the first one run: $ npm run res:dev
  3. In the second one run: $ npm run dev

Expected

devserver successfully starts

Actual

⚠ Invalid next.config.mjs options detected:
⚠ "transpilePackages[1]" is missing, expected string
⚠ See more info here: https://nextjs.org/docs/messages/invalid-next-config
TypeError: Cannot read properties of undefined (reading 'replace')
at Array.map ()

Root cause

I briefly checked why this is happening.

It seems that in rescript 12 configuration files
removed "bs-" and "bsc-" prefixes

RescriptJsonUtils.modernizeConfigurationFields(config)

Configuration for next.js pulls modules from rescript configuration file and expect "bs-" prefixed key.

Activity

  1. changed the title [-]create-rescript-app does not generate working app for rescript 12[/-] [+]create-rescript-app does not generate working app for rescript 12 + Next.js[/+] on Mar 1, 2026
  2. changed the title [-]create-rescript-app does not generate working app for rescript 12 + Next.js[/-] [+]create-rescript-app produces broken app for rescript 12 + Next.js[/+] on Mar 1, 2026
  3. changed the title [-]create-rescript-app produces broken app for rescript 12 + Next.js[/-] [+]create-rescript-app produces broken configuration for Next.js if rescript 12 is used[/+] on Mar 1, 2026
  4. fhammerschmidt commented on Mar 2, 2026

    @fhammerschmidt
    Member

    Fixed by #118

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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