I am building the acul react boilerplate app and have configured my tenant through the management API to call out for the file \assets\login\index.js in my static folder. I see the request for the file come through my browser after making the management API call so I believe it is configured correctly, but the browser seems to be failing to process the js file as I am getting Uncaught SyntaxError: Cannot use import statement outside a module Index.js:1.
I did also try to configure a vite bundle config since a lot of the ACUL resources show configuration with a bundle but the docs suggest the regular build should be a production option.
Yea, I was trying something a bit like that yesterday my vite.config to get my configuration closer to ACUL calling out for an actual bundle.js file. This is my bundling file that I also have been trialing:
I also added a bundle specific build referencing that config ābuild:bundleā: āvite build --config vite.bundle.config.tsā
This does seem to make it a little further but I cannot bypass this error
react-jsx-runtime.development.js:304 Uncaught TypeError: Cannot read properties of undefined (reading ā__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADEā)
Iām pretty sure this is because of Reach versions conflicting but my attempts to fix this are fruitless. See things like dedupe: [āreactā, āreact-domā] in my build.
The includsion of the process library was also to bypass some runtime issues.
Basically, by removing rollupOptions, it should make React external and have Vite pull it in to make it part of the bundle since there might be an instance conflict in your current configuration. Unfortunately, your bundle.js will now be larger because it contains the entire React library.