Welcome in hell: ACE with ES6 modules only

Hello there,

I am trying the whole day to get running the current version 8.7.0 of ACE. But there are some major issue I cannot get solved.

Let’s start with the official atlassian-connect-express-template (Bitbucket) out of the Atlassian Bitbucket. This template is the foundation for atlas-connect command line tool.

  1. server-side-rendering.js
    There are two require calls on line 42 and 43. This cannot work because in package.json there is “type”: “module”

I have changed this to dynamic imports:

const Component = (await import(`file://${nodeViewPath}`)).default;

2.parcelRequire is not defined
Changed routes/index.js to try out the react stuff. Now I am getting this error:

ReferenceError: parcelRequire is not defined
    at file:///.../enbl.it/atlassian-connect-express-template/views/node/hello-world.js:112:17
    at file:///../enbl.it/atlassian-connect-express-template/views/node/hello-world.js:120:3
    at ModuleJob.run (node:internal/modules/esm/module_job:194:25)

I have no idea how I can fix this. I could be that with ES6 modules the struct mode of JavaScript is active and the generated Parcel builds has no let or var in fron to the variable parcelRequire. This cannot be changed because it will regenerated every time.

Ok. I have excpected a little bit more, so I go backwards to 8.6.0. But this doesn’t work anymore, because esm fails. It fails hard, the app dies without any error message:

[watch-server] [nodemon] 2.0.20
[watch-server] [nodemon] to restart at any time, enter `rs`
[watch-server] [nodemon] watching path(s): *.*
[watch-server] [nodemon] watching extensions: js
[watch-server] [nodemon] starting `node -r esm app.js`
[watch-server] Tue, 26 Dec 2023 17:45:00 GMT morgan deprecated default format: use combined format at node_modules/esm/esm.js:1:278827
.../enbl.it/enblit-platform/apps/enblit-confluence-app-poc/node_modules/esm/esm.js:1
[FULL CONTENT OF esm.js

The last version that works with esm is before 8.1.0.

  1. Parcel is outdated
    in the template Parcel 1 will be used, but this isn’t maintained anymore, but the switch to V2 isn’t so easy. My expectation is that no outdated libraries will be used in an official template.

Summary
Very unsatisfying. I have no idea how to proceed. Of cource I can work with 8.0.2. But in the near future I need to update, but this doesn’t work for me.

Perhaps anyone here has some ideas or better the problems will be fixed as soon as possible. Or - perhaps - I have done anything wrong. Than I am glad to get advice whats wrong.

I have forked the repository of the template and pushed my changes in it. Feel free to check it out.
https://bitbucket.org/thorque73/atlassian-connect-express-template/src/develop/

Thanks in advance
Thorsten