Giter Site home page Giter Site logo

dom-lib's Issues

Cannot find name 'webkitRequestAnimationFrame'

Error below occurred while I build a vite.js react-ts project integrated with rsuite.

node_modules/dom-lib/lib/animation/nativeRequestAnimationFrame.d.ts:1:32 - error TS2304: Cannot find name 'webkitRequestAnimationFrame'.

1 declare const _default: typeof webkitRequestAnimationFrame;

I try to replace webkitRequestAnimcationFrame with requestAnimationFrame in nativeRequestAnimationFrame.d.ts, and then it works.

dependencies:

  • rsuite: "^5.0.3"
  • typescript: "4.3.2"

Can't resolve '@babel/runtime/helpers/esm/extends'

webpack 4.33.0; babel 7;
when npm run start . this error appear

./node_modules/dom-lib/es/query/getPosition.js
Module not found: Can't resolve '@babel/runtime/helpers/esm/extends' in '/Users/weichangyue/sunlord/产品域/psm-web/node_modules/dom-lib/es/query'

ESM Build?

First off, rsuite looks gorgeous! Great job on the library.

I'm having trouble building rsuite with rollup, and I've traced it back to this library:

Error: 'getOffset' is not exported by node_modules/dom-lib/lib/index.js
    at error (/home/fkschott/pika-monorepo/node_modules/rollup/dist/rollup.js:9408:30)
    at Module.error (/home/fkschott/pika-monorepo/node_modules/rollup/dist/rollup.js:13347:9)

I believe this is because it's having trouble understanding the interface to your Common.js lib build:

// lib/index.js
var _query = require("./query");
Object.keys(_query).forEach(function (key) {
  if (key === "default" || key === "__esModule") return;
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
  Object.defineProperty(exports, key, {
    enumerable: true,
    get: function get() {
      return _query[key];
    }
  });
});

Since your source directory is written with ESM, it would be nice to build an ESM build with your package as well. This would give consumers better tree-shaking, and also help bundlers like rollup better understand the package code.

Here are a few links to help:

Cannot deploy to Cloudflare Pages using Remix

I'm running a Remix app that does SSR on Cloudflare Pages. When running in development locally, and when building locally, things work as expected. But as soon as I deploy to Cloudflare using wrangler deploy, I get this error. The stacktrace points to a setTimeout in requestAnimationFramePolyfill.js:

✘ [ERROR] service core:user:site: Uncaught Error: Disallowed operation called within global scope. Asynchronous I/O (ex: fetch() or connect()), setting a timeout, and generating random values are not allowed within global scope. To fix this error, perform this operation within a handler. https://developers.cloudflare.com/workers/runtime-apis/handlers/

    at null.<anonymous> (7alu3beitb9.js:50167:12) in _setTimeout
    at null.<anonymous> (7alu3beitb9.js:50185:5) in
  ../node_modules/dom-lib/esm/requestAnimationFramePolyfill.js
    at null.<anonymous> (7alu3beitb9.js:9:56) in __init
    at null.<anonymous> (7alu3beitb9.js:50294:5) in
  ../node_modules/dom-lib/esm/DOMMouseMoveTracker.js
    at null.<anonymous> (7alu3beitb9.js:9:56) in __init
    at null.<anonymous> (7alu3beitb9.js:62379:5) in
  ../node_modules/rsuite-table/es/ColumnResizeHandler.js
    at null.<anonymous> (7alu3beitb9.js:9:56) in __init
    at null.<anonymous> (7alu3beitb9.js:62662:5) in
  ../node_modules/rsuite-table/es/HeaderCell.js
    at null.<anonymous> (7alu3beitb9.js:9:56) in __init
    at null.<anonymous> (7alu3beitb9.js:62851:5) in
  ../node_modules/rsuite-table/es/utils/mergeCells.js

I believe this is happening because requestAnimationFramePolyfill(emptyFunction); is getting called in the global scope.

I see this is a workaround for Safari 6 -- would it be OK to remove? Or perhaps move to another location so that it doesn't execute in the global scope? Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.