serglider / shake-detector Goto Github PK
View Code? Open in Web Editor NEWMobile device shakes detection
License: MIT License
Mobile device shakes detection
License: MIT License
To produce this problem:
create-vite
and choose vanilla-tsshake-detector
main.ts
import ShakeDetector from 'shake-detector'
const shakeDetector = new ShakeDetector({}).confirmPermissionGranted();
shakeDetector.subscribe(() => {
console.log('Shake detected!')
}).start();
npx vite --host
and open a link from network (note: the local link works fine)Then it will show the error in the console:
Uncaught ReferenceError: DeviceMotionEvent is not defined
at new h (utils.ts:28:19)
at new m (index.ts:41:30)
at main.ts:13:23
When I try to click into the utils.ts:28
, it shows another error message:
Could not load content for http://172.17.0.1:3001/node_modules/shake-detector/src/utils.ts (HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE)
Versions:
"typescript": "^4.5.4",
"vite": "^2.8.0"
"shake-detector": "^0.3.7",
OS: Manjaro Linux x86_64
Browser: Chrome
Hi am getting this error can you help me.
ERROR in node_modules/shake-detector/types/index.d.ts:7:13 - error TS1005: '=' expected.
7 import type { UserOptions, ShakeHandler } from './types';
~
node_modules/shake-detector/types/index.d.ts:7:48 - error TS1005: ';' expected.
7 import type { UserOptions, ShakeHandler } from './types';
~~~~~~~~~
node_modules/shake-detector/types/interfaces/IShakeDetector.d.ts:1:13 - error TS1005: '=' expected.
1 import type { ShakeHandler } from '../types';
~
node_modules/shake-detector/types/interfaces/IShakeDetector.d.ts:1:35 - error TS1005: ';' expected.
1 import type { ShakeHandler } from '../types';
~~~~~~~~~~
[ERROR] An error occurred while running subprocess ng.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.