Error when saving an auto-numbered page

I’m seeing a weird interaction between auto-numbering pages and a plugin defining a JS file, which prevents pages being published.

I’m able to recreate it starting from Plainkit like this:

Put this in site/blueprints/pages/default.yml (auto-numbers pages by a date field)

title: Default Page
num: '{{ page.date.toDate("Ymd") }}'
columns:
  main:
    width: 2/3
    sections:
      fields:
        type: fields
        fields:
          date:
            type: date
            required: true
            default: now
  sidebar:
    width: 1/3
    sections:
      pages:
        type: pages
        template: default
      files:
        type: files

Create site/plugins/my-plugin/index.js. It can be empty.

Create a new page and try to make it public. I get a 400 response with: The plugin “plugins/my-plugin” has already been registered

Other auto-numbering options seem to work. Can you recreate this? Am I missing something?

The error will go away if you add an index.php with the basic Kirby::plugin('superwoman/superplugin', []); content in your plugin folder.

But seems to be a bug, because the index.php is not required for panel-only plugins.

You’re right, that works. I thought I had tried it already. Thanks!