CrowdStrike / ember-headless-form

Headless forms with a11y and validation support built in
https://ember-headless-form.pages.dev/
MIT License
28 stars 6 forks source link

error about cached-decorator-polyfill? #146

Open NullVoxPopuli opened 1 year ago

NullVoxPopuli commented 1 year ago

Seeing this in my app's error logs after adding headless-form:

Module not found: Error: 
  ember-headless-form is trying to import from ember-cached-decorator-polyfill but that is not one of its explicit dependencies

Using 1.0.0-beta.3

/docs-app/node_modules/ember-headless-form on  popover [!?] 
❯ cat package.json | jq '.version'
"1.0.0-beta.3"

Maybe this is an embroider whoopsie (I'm not using the classic build pipeline)

❯ ag cached-decorator --stats
0 matches
0 files contained matches
60 files searched
509375 bytes searched
0.007827 seconds
simonihmig commented 1 year ago

Weird, ember-cached-decorator-polyfill seems to trigger weird errors here and there. I was running into https://github.com/embroider-build/ember-auto-import/issues/582 when using headless-table with the latest eai. Though your case is certainly different...

Where do you get ember-cached-decorator-polyfill from? Your app is on Ember 4.4+? (which should require the polyfill)

My understanding from this is that the transform that introducing @embroider/macros and an eventual importSync('ember-cached-decorator-polyfill') is only applied to the parent addon of ember-cached-decorator-polyfill, so one that depends on it, which this addon does not!? 🤔

So definitely seems goofy, and not the fault of this addon, just not sure whose fault this is...

ynotdraw commented 1 year ago

I'm also seeing this over on https://github.com/CrowdStrike/ember-toucan-core. Reproduction steps:

# clone repo
pnpm i
bash /local-setup.bash # select option 1 or build each addon under packages/*, up to you
cd docs-app
pnpm start

Then the error appears:

webpack 5.75.0 compiled with 1 error and 1 warning in 2409 ms
Build Error (PackagerRunner) in ../node_modules/.pnpm/ember-headless-form@1.0.0-beta.3_@glimmer+componen_xgihesckq67deavdobdctlgt6u/node_modules/ember-headless-form/dist/components/headless-form.js

Module build failed (from ../../../../../../../../../workspace/ember-toucan-core/node_modules/.pnpm/thread-loader@3.0.4_webpack@5.75.0/node_modules/thread-loader/dist/cjs.js):
Thread Loader (Worker 2)
$TMPDIR/embroider/835ae7/node_modules/.pnpm/ember-headless-form@1.0.0-beta.3_@glimmer+componen_xgihesckq67deavdobdctlgt6u/node_modules/ember-headless-form/dist/components/headless-form.js/headless-form.js: ember-headless-form is trying to import from ember-cached-decorator-polyfill but that is not one of its explicit dependencies

FWIW, CI was happy about this and running pnpm build is fine, but running pnpm start throws this error

simonihmig commented 1 year ago

I wrote down my findings here: https://github.com/embroider-build/embroider/issues/1462.

Reopening as this was accidentally auto-closed...