IanM Thanks IanM!
I did make this change and made many others to manually export, but I reverted all my changes and removed this section alone. I removed node_modules and dist, did yarn install.
With "yarn build", I go back to the square 1 error:
ERROR in ./forum.js 1:10
Module parse failed: Unexpected keyword 'default' (1:10)
File was processed with these loaders:
* ./node_modules/flarum-webpack-config/src/autoExportLoader.cjs
* ./node_modules/flarum-webpack-config/src/autoChunkNameLoader.cjs
* ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
import { default } from './src/forum';
| export { default };
| flarum.reg.add('askvortsov-categories', '../forum', { default: default, });
And then when I make the change @clarkwinkelmann suggested, I go back to the defineProperty error although the stack is slightly different.
ERROR in ./node_modules/@babel/runtime/helpers/esm/defineProperty.js 11:119
Module parse failed: Unexpected token (11:119)
File was processed with these loaders:
* ./node_modules/flarum-webpack-config/src/autoExportLoader.cjs
* ./node_modules/flarum-webpack-config/src/autoChunkNameLoader.cjs
* ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| }
| export { _defineProperty as default };
flarum.reg.add('askvortsov-categories', '../node_modules/@babel/runtime/helpers/esm/defineProperty', { _defineProperty as default: _defineProperty as default, });
@ ./src/forum/components/Category.tsx 1:0-72 23:4-19 24:4-19 25:4-19 26:4-19 27:4-19
@ ./src/forum/index.js 9:0-45
@ ./forum.js 1:0-28 1:0-28
I've tried removing/rewriting all the exports I could find, but this defineProperty thing I haven't been able to track down... I'm not sure what causes this to come into play.