Commit 1402eef
committed
fix(build): use non-destructured require for @strapi/utils
Prevents the same runtime crash pattern that hit magic-link:
pack-up's rollup-commonjs rewrites `const { errors } = require('@strapi/utils')`
into `_interopDefault(...).default.errors`. For the dual ESM/CJS
@strapi/utils package, `.default` does not expose `errors`, so the
destructured value resolves to undefined at runtime and any call
through `errors.XxxError` crashes on plugin boot.
Direct property access after a plain require() is not rewritten by
rollup-commonjs:
const { errors } = require('@strapi/utils')
-> const errors = require('@strapi/utils').errors1 parent 2100783 commit 1402eef
1 file changed
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
20 | 24 | | |
21 | 25 | | |
22 | 26 | | |
| |||
0 commit comments