ember-animation / ember-animated

Core animation primitives for Ember.
https://ember-animation.github.io/ember-animated/
MIT License
245 stars 90 forks source link

Error after upgrade from `1.0.4` to `1.1.0` #642

Closed villander closed 11 months ago

villander commented 1 year ago

Describe the bug

webpack 5.89.0 compiled with 1 error in 27159 ms
Build Error (PackagerRunner) in node_modules/.pnpm/ember-animated@1.1.0_@ember+test-helpers@3.2.1_@glint+environment-ember-loose@1.2.1_@glint+te_hhmkdx6mig5dym7nzubpufr57q/node_modules/ember-animated/dist/components/animated-container.js

Module build failed (from ../../../../../../../../Users/villander/Projects/project-ui/node_modules/.pnpm/thread-loader@3.0.4_webpack@5.89.0/node_modules/thread-loader/dist/cjs.js):
Thread Loader (Worker 9)
$TMPDIR/embroider/2012c7/node_modules/.pnpm/ember-animated@1.1.0_@ember+test-helpers@3.2.1_@glint+environment-ember-loose@1.2.1_@glint+te_hhmkdx6mig5dym7nzubpufr57q/node_modules/ember-animated/dist/components/animated-container.js/animated-container.js: Unsafe dynamic component: cannot statically analyze this expression in node_modules/.pnpm/ember-animated@1.1.0_@ember+test-helpers@3.2.1_@glint+environment-ember-loose@1.2.1_@glint+te_hhmkdx6mig5dym7nzubpufr57q/node_modules/ember-animated/dist/components/animated-container.js

    at CompatResolver.reportError (/Users/villander/Projects/project-ui/node_modules/.pnpm/@embroider+compat@2.0.2_patch_hash=xfwpwlobabhwhrnzagwhtrsove_@embroider+core@2.0.2/node_modules/@embroider/compat/src/resolver.js:219:21)
    at emit (/Users/villander/Projects/project-ui/node_modules/.pnpm/@embroider+compat@2.0.2_patch_hash=xfwpwlobabhwhrnzagwhtrsove_@embroider+core@2.0.2/node_modules/@embroider/compat/src/resolver-transform.js:27:30)
    at SubExpression (/Users/villander/Projects/project-ui/node_modules/.pnpm/@embroider+compat@2.0.2_patch_hash=xfwpwlobabhwhrnzagwhtrsove_@embroider+core@2.0.2/node_modules/@embroider/compat/src/resolver-transform.js:137:25)
    at visitNode ($TMPDIR/embroider/2012c7/node_modules/.pnpm/ember-source@5.4.0_@babel+core@7.23.3_@glimmer+component@1.1.2_@glint+template@1.2.1_rsvp@4.8.5_webpack@5.89.0/node_modules/ember-source/vendor/ember/ember-template-compiler.js:9213:16)
    at visitArray ($TMPDIR/embroider/2012c7/node_modules/.pnpm/ember-source@5.4.0_@babel+core@7.23.3_@glimmer+component@1.1.2_@glint+template@1.2.1_rsvp@4.8.5_webpack@5.89.0/node_modules/ember-source/vendor/ember/ember-template-compiler.js:9289:20)
    at visitKey ($TMPDIR/embroider/2012c7/node_modules/.pnpm/ember-source@5.4.0_@babel+core@7.23.3_@glimmer+component@1.1.2_@glint+template@1.2.1_rsvp@4.8.5_webpack@5.89.0/node_modules/ember-source/vendor/ember/ember-template-compiler.js:9268:7)
    at visitNode ($TMPDIR/embroider/2012c7/node_modules/.pnpm/ember-source@5.4.0_@babel+core@7.23.3_@glimmer+component@1.1.2_@glint+template@1.2.1_rsvp@4.8.5_webpack@5.89.0/node_modules/ember-source/vendor/ember/ember-template-compiler.js:9231:9)
    at visitArray ($TMPDIR/embroider/2012c7/node_modules/.pnpm/ember-source@5.4.0_@babel+core@7.23.3_@glimmer+component@1.1.2_@glint+template@1.2.1_rsvp@4.8.5_webpack@5.89.0/node_modules/ember-source/vendor/ember/ember-template-compiler.js:9289:20)
    at visitKey ($TMPDIR/embroider/2012c7/node_modules/.pnpm/ember-source@5.4.0_@babel+core@7.23.3_@glimmer+component@1.1.2_@glint+template@1.2.1_rsvp@4.8.5_webpack@5.89.0/node_modules/ember-source/vendor/ember/ember-template-compiler.js:9268:7)
    at visitNode ($TMPDIR/embroider/2012c7/node_modules/.pnpm/ember-source@5.4.0_@babel+core@7.23.3_@glimmer+component@1.1.2_@glint+template@1.2.1_rsvp@4.8.5_webpack@5.89.0/node_modules/ember-source/vendor/ember/ember-template-compiler.js:9231:9)
    at visitKey ($TMPDIR/embroider/2012c7/node_modules/.pnpm/ember-source@5.4.0_@babel+core@7.23.3_@glimmer+component@1.1.2_@glint+template@1.2.1_rsvp@4.8.5_webpack@5.89.0/node_modules/ember-source/vendor/ember/ember-template-compiler.js:9271:20)
    at visitNode ($TMPDIR/embroider/2012c7/node_modules/.pnpm/ember-source@5.4.0_@babel+core@7.23.3_@glimmer+component@1.1.2_@glint+template@1.2.1_rsvp@4.8.5_webpack@5.89.0/node_modules/ember-source/vendor/ember/ember-template-compiler.js:9231:9)
    at visitArray ($TMPDIR/embroider/2012c7/node_modules/.pnpm/ember-source@5.4.0_@babel+core@7.23.3_@glimmer+component@1.1.2_@glint+template@1.2.1_rsvp@4.8.5_webpack@5.89.0/node_modules/ember-source/vendor/ember/ember-template-compiler.js:9289:20)
    at visitKey ($TMPDIR/embroider/2012c7/node_modules/.pnpm/ember-source@5.4.0_@babel+core@7.23.3_@glimmer+component@1.1.2_@glint+template@1.2.1_rsvp@4.8.5_webpack@5.89.0/node_modules/ember-source/vendor/ember/ember-template-compiler.js:9268:7)
    at visitNode ($TMPDIR/embroider/2012c7/node_modules/.pnpm/ember-source@5.4.0_@babel+core@7.23.3_@glimmer+component@1.1.2_@glint+template@1.2.1_rsvp@4.8.5_webpack@5.89.0/node_modules/ember-source/vendor/ember/ember-template-compiler.js:9231:9)
    at traverse ($TMPDIR/embroider/2012c7/node_modules/.pnpm/ember-source@5.4.0_@babel+core@7.23.3_@glimmer+component@1.1.2_@glint+template@1.2.1_rsvp@4.8.5_webpack@5.89.0/node_modules/ember-source/vendor/ember/ember-template-compiler.js:9326:5)
    at preprocess ($TMPDIR/embroider/2012c7/node_modules/.pnpm/ember-source@5.4.0_@babel+core@7.23.3_@glimmer+component@1.1.2_@glint+template@1.2.1_rsvp@4.8.5_webpack@5.89.0/node_modules/ember-source/vendor/ember/ember-template-compiler.js:10652:9)
    at normalize ($TMPDIR/embroider/2012c7/node_modules/.pnpm/ember-source@5.4.0_@babel+core@7.23.3_@glimmer+component@1.1.2_@glint+template@1.2.1_rsvp@4.8.5_webpack@5.89.0/node_modules/ember-source/vendor/ember/ember-template-compiler.js:11192:15)
    at precompileJSON ($TMPDIR/embroider/2012c7/node_modules/.pnpm/ember-source@5.4.0_@babel+core@7.23.3_@glimmer+component@1.1.2_@glint+template@1.2.1_rsvp@4.8.5_webpack@5.89.0/node_modules/ember-source/vendor/ember/ember-template-compiler.js:4981:47)
    at precompile ($TMPDIR/embroider/2012c7/node_modules/.pnpm/ember-source@5.4.0_@babel+core@7.23.3_@glimmer+component@1.1.2_@glint+template@1.2.1_rsvp@4.8.5_webpack@5.89.0/node_modules/ember-source/vendor/ember/ember-template-compiler.js:5014:31)
    at Object.precompile ($TMPDIR/embroider/2012c7/node_modules/.pnpm/ember-source@5.4.0_@babel+core@7.23.3_@glimmer+component@1.1.2_@glint+template@1.2.1_rsvp@4.8.5_webpack@5.89.0/node_modules/ember-source/vendor/ember/ember-template-compiler.js:16294:37)
    at insertCompiledTemplate (/Users/villander/Projects/project-ui/node_modules/.pnpm/babel-plugin-ember-template-compilation@2.0.0/node_modules/babel-plugin-ember-template-compilation/src/plugin.js:197:64)
    at PluginPass.CallExpression (/Users/villander/Projects/project-ui/node_modules/.pnpm/babel-plugin-ember-template-compilation@2.0.0/node_modules/babel-plugin-ember-template-compilation/src/plugin.js:129:25)
    at PluginPass.<anonymous> (/Users/villander/Projects/project-ui/node_modules/.pnpm/@embroider+core@2.0.2/node_modules/@embroider/core/src/portable-babel-launcher.js:37:29)
    at newFn (/Users/villander/Projects/project-ui/node_modules/.pnpm/@babel+traverse@7.23.3_supports-color@8.1.1/node_modules/@babel/traverse/lib/visitors.js:160:14)
    at NodePath._call (/Users/villander/Projects/project-ui/node_modules/.pnpm/@babel+traverse@7.23.3_supports-color@8.1.1/node_modules/@babel/traverse/lib/path/context.js:46:20)
    at NodePath.call (/Users/villander/Projects/project-ui/node_modules/.pnpm/@babel+traverse@7.23.3_supports-color@8.1.1/node_modules/@babel/traverse/lib/path/context.js:36:17)
    at NodePath.visit (/Users/villander/Projects/project-ui/node_modules/.pnpm/@babel+traverse@7.23.3_supports-color@8.1.1/node_modules/@babel/traverse/lib/path/context.js:82:31)
    at TraversalContext.visitQueue (/Users/villander/Projects/project-ui/node_modules/.pnpm/@babel+traverse@7.23.3_supports-color@8.1.1/node_modules/@babel/traverse/lib/context.js:86:16)
    at TraversalContext.visitSingle (/Users/villander/Projects/project-ui/node_modules/.pnpm/@babel+traverse@7.23.3_supports-color@8.1.1/node_modules/@babel/traverse/lib/context.js:65:19)
    at TraversalContext.visit (/Users/villander/Projects/project-ui/node_modules/.pnpm/@babel+traverse@7.23.3_supports-color@8.1.1/node_modules/@babel/traverse/lib/context.js:109:19)
    at traverseNode (/Users/villander/Projects/project-ui/node_modules/.pnpm/@babel+traverse@7.23.3_supports-color@8.1.1/node_modules/@babel/traverse/lib/traverse-node.js:22:17)
    at NodePath.visit (/Users/villander/Projects/project-ui/node_modules/.pnpm/@babel+traverse@7.23.3_supports-color@8.1.1/node_modules/@babel/traverse/lib/path/context.js:88:52)
    at TraversalContext.visitQueue (/Users/villander/Projects/project-ui/node_modules/.pnpm/@babel+traverse@7.23.3_supports-color@8.1.1/node_modules/@babel/traverse/lib/context.js:86:16)
    at TraversalContext.visitMultiple (/Users/villander/Projects/project-ui/node_modules/.pnpm/@babel+traverse@7.23.3_supports-color@8.1.1/node_modules/@babel/traverse/lib/context.js:61:17)
    at TraversalContext.visit (/Users/villander/Projects/project-ui/node_modules/.pnpm/@babel+traverse@7.23.3_supports-color@8.1.1/node_modules/@babel/traverse/lib/context.js:107:19)
    at traverseNode (/Users/villander/Projects/project-ui/node_modules/.pnpm/@babel+traverse@7.23.3_supports-color@8.1.1/node_modules/@babel/traverse/lib/traverse-node.js:22:17)
    at NodePath.visit (/Users/villander/Projects/project-ui/node_modules/.pnpm/@babel+traverse@7.23.3_supports-color@8.1.1/node_modules/@babel/traverse/lib/path/context.js:88:52)
    at TraversalContext.visitQueue (/Users/villander/Projects/project-ui/node_modules/.pnpm/@babel+traverse@7.23.3_supports-color@8.1.1/node_modules/@babel/traverse/lib/context.js:86:16)
    at TraversalContext.visitMultiple (/Users/villander/Projects/project-ui/node_modules/.pnpm/@babel+traverse@7.23.3_supports-color@8.1.1/node_modules/@babel/traverse/lib/context.js:61:17)
    at TraversalContext.visit (/Users/villander/Projects/project-ui/node_modules/.pnpm/@babel+traverse@7.23.3_supports-color@8.1.1/node_modules/@babel/traverse/lib/context.js:107:19)
    at traverseNode (/Users/villander/Projects/project-ui/node_modules/.pnpm/@babel+traverse@7.23.3_supports-color@8.1.1/node_modules/@babel/traverse/lib/traverse-node.js:22:17)
    at NodePath.visit (/Users/villander/Projects/project-ui/node_modules/.pnpm/@babel+traverse@7.23.3_supports-color@8.1.1/node_modules/@babel/traverse/lib/path/context.js:88:52)
    at TraversalContext.visitQueue (/Users/villander/Projects/project-ui/node_modules/.pnpm/@babel+traverse@7.23.3_supports-color@8.1.1/node_modules/@babel/traverse/lib/context.js:86:16)
    at TraversalContext.visitSingle (/Users/villander/Projects/project-ui/node_modules/.pnpm/@babel+traverse@7.23.3_supports-color@8.1.1/node_modules/@babel/traverse/lib/context.js:65:19)
    at TraversalContext.visit (/Users/villander/Projects/project-ui/node_modules/.pnpm/@babel+traverse@7.23.3_supports-color@8.1.1/node_modules/@babel/traverse/lib/context.js:109:19)
    at traverseNode (/Users/villander/Projects/project-ui/node_modules/.pnpm/@babel+traverse@7.23.3_supports-color@8.1.1/node_modules/@babel/traverse/lib/traverse-node.js:22:17)
    at traverse (/Users/villander/Projects/project-ui/node_modules/.pnpm/@babel+traverse@7.23.3_supports-color@8.1.1/node_modules/@babel/traverse/lib/index.js:52:34)
    at transformFile (/Users/villander/Projects/project-ui/node_modules/.pnpm/@babel+core@7.23.3_supports-color@8.1.1/node_modules/@babel/core/lib/transformation/index.js:82:31)
    at transformFile.next (<anonymous>)

Stack Trace and Error Report: /var/folders/0v/jpdg1flj3qscvbvt728pgt8c0000gn/T/error.dump.105f7af66d38349bd57879393bc890ee.log

To Reproduce Upgrade the package and run ember s

cc @SergeAstapov

SergeAstapov commented 1 year ago

ah probably caused by me removing ensure-safe-component from around -element helper in https://github.com/ember-animation/ember-animated/commit/8dcf0b710b6acc73cf38588b6471b2a31df205c0#diff-0e42f45c5eb4e779522a9dadc602ffdad9f1e8408da2893ef07b7802de342243.

johanrd commented 1 year ago

For what it's worth: here is a minimal reproduction: https://github.com/johanrd/ember-animated-dynamic-component-error-reproduction

RobbieTheWagner commented 11 months ago

Any updates on this?