Svelte with snowpack gives "Not Implemented: Animation" when trying to import transitions - css-animations

Usually, I can import a flip or other animations in svelte like this:
import { flip } from "svelte/animate";
However, I'm unsure why I'm getting the following error in snowpack with svelte:
Build Error: #snowpack/plugin-svelte
Error: Not implemented: Animation
Source
/Users/duane/Braid/ribbon/client/src/Posts/PostsPage.svelte
Error: Not implemented: Animation
at /Users/duane/Braid/ribbon/node_modules/svelte/compiler.js:27126:28
at Array.forEach (<anonymous>)
at new InlineComponent$1 (/Users/duane/Braid/ribbon/node_modules/svelte/compiler.js:27087:26)
at /Users/duane/Braid/ribbon/node_modules/svelte/compiler.js:27358:23
at Array.map (<anonymous>)
at map_children (/Users/duane/Braid/ribbon/node_modules/svelte/compiler.js:27353:22)
at new IfBlock$1 (/Users/duane/Braid/ribbon/node_modules/svelte/compiler.js:27063:26)
at /Users/duane/Braid/ribbon/node_modules/svelte/compiler.js:27358:23
at Array.map (<anonymous>)
at map_children (/Users/duane/Braid/ribbon/node_modules/svelte/compiler.js:27353:22)
at new Fragment (/Users/duane/Braid/ribbon/node_modules/svelte/compiler.js:27410:26)
at new Component (/Users/duane/Braid/ribbon/node_modules/svelte/compiler.js:27547:26)
at Object.compile (/Users/duane/Braid/ribbon/node_modules/svelte/compiler.js:28753:24)
at Object.load (/Users/duane/Braid/ribbon/node_modules/#snowpack/plugin-svelte/plugin.js:120:31)
at async runPipelineLoadStep (/Users/duane/Braid/ribbon/node_modules/snowpack/lib/index.js:74471:28)
at async Object.buildFile (/Users/duane/Braid/ribbon/node_modules/snowpack/lib/index.js:74638:24)
Am I missing something?

It turns out this has nothing to do with snowpack.
Instead, the "Not implemented: Animation" error arises when you try to add an "animate:flip" or "transition:slide" (for example) on a component (e.g. <MySpecialButton />). The animate: and transition: attributes can only go on DOM elements like <div />, etc.

Related

When i am try to run the test cases using jest in react native then i am getting this issue

TypeError: Cannot read properties of undefined (reading 'navigator')
enter image description here
// include this line for mocking react-native-gesture-handler
import 'react-native-gesture-handler/jestSetup';
// include this section and the NativeAnimatedHelper section for mocking react-native-reanimated
jest.mock('react-native-reanimated', () => {
const Reanimated = require('react-native-reanimated/mock');
// The mock for call immediately calls the callback which is incorrect
// So we override it with a no-op
Reanimated.default.call = () => {};
return Reanimated;
});
// Silence the warning: Animated: useNativeDriver is not supported because the native animated module is missing
jest.mock('react-native/Libraries/Animated/NativeAnimatedHelper');
I had created the one file for the set up and that file path set in package json file but, still this issue was not resolved.

Expo build: TypeError: Cannot convert undefined or null to object

When I try to build .apk file via expo I get the error like:
TypeError: Cannot convert undefined or null to object
at Function.entries (<anonymous>)
at renderIntentFilterDatumEntries (/app/turtle/node_modules/#expo/xdl/build/detach/AndroidIntentFilters.js:33:17)
at /app/turtle/node_modules/#expo/xdl/build/detach/AndroidIntentFilters.js:37:70
at Array.map (<anonymous>)
at renderIntentFilterData (/app/turtle/node_modules/#expo/xdl/build/detach/AndroidIntentFilters.js:37:48)
at /app/turtle/node_modules/#expo/xdl/build/detach/AndroidIntentFilters.js:25:9
at Array.map (<anonymous>)
at renderIntentFilters (/app/turtle/node_modules/#expo/xdl/build/detach/AndroidIntentFilters.js:22:24)
at runShellAppModificationsAsync (/app/turtle/node_modules/#expo/xdl/build/detach/AndroidShellApp.js:632:115)
at async Object.createAndroidShellAppAsync (/app/turtle/node_modules/#expo/xdl/build/detach/AndroidShellApp.js:392:3)
at async runShellAppBuilder (/app/turtle/build/builders/android.js:95:9)
at async Object.buildAndroid [as android] (/app/turtle/build/builders/android.js:43:28)
at async build (/app/turtle/build/jobManager.js:181:33)
at async processJob (/app/turtle/build/jobManager.js:118:32)
at async Object.doJob (/app/turtle/build/jobManager.js:49:5)
at async main (/app/turtle/build/server.js:66:13)
In test and develop mode, everything works fine.
Check expo build does not work
Specifically check next answer:
For anyone else experiencing this issue, make sure you’re formatting your intent filter >property correctly. The proper format is shown here- https://docs.expo.io/versions/latest/config/app/#intentfilters

How to import images dynamically using Webpack in Electron JS (Vue JS)

I tried a lot of ways to import pngs dynamically but it keeps saying..
Uncaught (in promise) Error: Cannot find module './SGSkysTheLimit.png'
at webpackContextResolve (eval at ./src/renderer/assets/img/square sync recursive ^\.\/.*\.png$ (renderer.js:5418), <anonymous>:374:11)
at webpackContext (eval at ./src/renderer/assets/img/square sync recursive ^\.\/.*\.png$ (renderer.js:5418), <anonymous>:369:11)
at VueComponent._callee2$ (TestComponent.vue?87f2:114)
at tryCatch (runtime.js?96cf:62)
at Generator.invoke [as _invoke] (runtime.js?96cf:296)
at Generator.prototype.<computed> [as next] (runtime.js?96cf:114)
at step (asyncToGenerator.js?0f75:17)
at eval (asyncToGenerator.js?0f75:35)
at new Promise (<anonymous>)
at new F (_export.js?63b6:36)
I tried solutions like these
Example 1:
<img :src="fileName(game.key_name)">
Example 2:
<img :src="require(`../assets/img/square/${game.key_name}.png`)">
async fileName(filename) {
// Not working
const image = await require(`../assets/img/square/${filename}.png`)
return image
// Not working
return import(`../assets/img/square/${filename}.png`)
// Not working
let image = `../assets/img/square/${filename}.png`
return require(image)
// Not working
return require(`../assets/img/square/${image}`)
// Not working
var images = require.context('../assets/img/square/', false, /\.png$/)
return images('./' + filename + ".png")
// Working
return require("../assets/img/square/SGJellyfishFlow.png")
// but the problem is I need image is dynamically imported
}
App\src\renderer\assets\img\square\SGSkysTheLimit.png
I tried a lot of search on stackoverflow and github but all of them not fix my problem.

Jest unable to load module vue-cookies

console.error node_modules/vue/dist/vue.runtime.common.dev.js:621
[Vue warn]: Error in mounted hook (Promise/async): "TypeError: Cannot read property 'get' of undefined"
found in
---> <Anonymous>
<Root>
console.error node_modules/vue/dist/vue.runtime.common.dev.js:1884
TypeError: Cannot read property 'get' of undefined
at VueComponent.mounted (/home/ubuntu/vue-testing-skel/src/components/ChatApp.vue:66:1)
The line that is causing the error:
this.current_nickname = this.$cookies.get('nickname')
this.$cookies is provided by a module called vue-cookies
I have it installed and saved in my devDependencies, but it seems jest is unable to find it or load it.
I'm not sure what I have to do to make sure Jest is loading these modules properly.
Testing with Jest is meant to be self-contained. This means that global objects like this.$cookies are not available since they are interfacing with the cookies in your browser. The way to solve this is to mock the global functions. More info on how to do that here:
https://lmiller1990.github.io/vue-testing-handbook/mocking-global-objects.html#example-with-vue-i18n
To build off of #Imre_G 's answer, you need to specify a $cookies key inside your mount() or shallowMount() function, like so:
wrapper = shallowMount(ComponentName, {
localVue,
...
mocks: {
$cookies: {
get: jest.fn().mockReturnValue(null),
set: jest.fn(),
}
}
});

angular2 testing, error in ViewUtils when using setBaseTestProviders()

When using the method 'setBaseTestProviders(..)', an error pops up in the console.
We're using angular-2.0.0-rc.1.
The test (test/areas-list.component.spec.ts) is as follows:
import {setBaseTestProviders} from "#angular/core/testing";
import {ADDITIONAL_TEST_BROWSER_PROVIDERS, TEST_BROWSER_STATIC_PLATFORM_PROVIDERS} from '#angular/platform-browser/testing/browser_static';
import {BROWSER_APP_DYNAMIC_PROVIDERS} from '#angular/platform-browser-dynamic';
setBaseTestProviders([
BROWSER_APP_DYNAMIC_PROVIDERS,
ADDITIONAL_TEST_BROWSER_PROVIDERS,
], TEST_BROWSER_STATIC_PLATFORM_PROVIDERS);
describe('test test', () => {
//Not really important
});
When I open the browser, the following error is shown in the console:
zone.js:323 Error: Error: Cannot resolve all parameters for 'ViewUtils'(RootRenderer, undefined #Inject(Token AppId), SanitizationService). Make sure that all the parameters are decorated with Inject or have valid type annotations and that 'ViewUtils' is decorated with Injectable.
at NoAnnotationError.BaseException [as constructor] (http://127.0.0.1:8080/node_modules/#angular/core/src/facade/exceptions.js:17:23)
at new NoAnnotationError (http://127.0.0.1:8080/node_modules/#angular/core/src/di/reflective_exceptions.js:217:16)
at _extractToken (http://127.0.0.1:8080/node_modules/#angular/core/src/di/reflective_provider.js:232:15)
at eval (http://127.0.0.1:8080/node_modules/#angular/core/src/di/reflective_provider.js:184:45)
at Array.map (native)
at _dependenciesFor (http://127.0.0.1:8080/node_modules/#angular/core/src/di/reflective_provider.js:184:19)
at resolveReflectiveFactory (http://127.0.0.1:8080/node_modules/#angular/core/src/di/reflective_provider.js:72:24)
at resolveReflectiveProvider (http://127.0.0.1:8080/node_modules/#angular/core/src/di/reflective_provider.js:96:97)
at Array.map (native)
at Object.resolveReflectiveProviders (http://127.0.0.1:8080/node_modules/#angular/core/src/di/reflective_provider.js:104:31)
Evaluating http://127.0.0.1:8080/test/areas-list.component.spec.js
Error loading http://127.0.0.1:8080/test/areas-list.component.spec.js
Does somebody know what the problem is? Thanks in advance!
Is there any specific case you're trying to achieve with browser static?
Here is the basic config:
import { setBaseTestProviders } from '#angular/core/testing';
import {
TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS,
TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS,
} from '#angular/platform-browser-dynamic/testing';
setBaseTestProviders(TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS, TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS);