Error: can not handle multiple files


I tried to run npm run bs:start in

The error is

bsb: [21/318] src/Playground.cmi
FAILED: src/Playground.cmi
can not handle multiple files

This error appears for multiple other files.
What could be the issue?

Not sure what this is. Could you file an issue on GitHub instead?

I’d need more context, since I don’t understand how this can happen

  • Did you do a fresh clone? (no stale state?)
  • If not, did you update to the newest deps, and cleared prev. artifacts with npm run bs:clean?

Yes I did a fresh clone.

  1. I installed the node_modules.
  2. When I run npm run bs:build it fails.
bsb: [18/318] src/Design.cmi
FAILED: src/Design.cmi
can not handle multiple files

I used windows and git bash.

It may be bsc is used to compile multiple files in the command line.

is this a windows related issue?

For anyone interested, I was running into the same problem on windows.

It turned out that the name in my bsconfig.json had a space. I changed the name into a kebab-cased-name and the problem went away.

This caused my error:

  "name": "Rescript next.js-app",
   // ... snip

This solved my error:

  "name": "rescript-nextjs-app",
   // ... snip

Not sure if this solves the problem of the OP, but perhaps it might help someone out there who made the same mistake as I have :slight_smile:


Cool, would you file an issue on github so we can give an error message earlier?

I will! :slight_smile:

Hi, I’m here because I got this error.
And the problem was the space of the “name” value in bsconfig.json
the error displayed by the compiler at the moment is also not informative " .cmj
can not handle multiple files "