alvarocastro / ember-draggable-modifiers

Drag and drop modifiers for Ember.js
https://alvarocastro.github.io/ember-draggable-modifiers/
MIT License
0 stars 0 forks source link

These modifiers are problematic in FastBoot #1

Open habdelra opened 3 days ago

habdelra commented 3 days ago

when we use these modifiers on an app that is rendered in fastboot we get the following error:

navigator is not defined
    at isSafari (/tmp/tmp-3745-MUv3E5mw4c2K/assets/chunk.eef8c6cd3847f29b44f1.js:6252:20)
    at wrapped (/tmp/tmp-3745-MUv3E5mw4c2K/assets/chunk.eef8c6cd3847f29b44f1.js:5753:23)
    at fixSafari (/tmp/tmp-3745-MUv3E5mw4c2K/assets/chunk.eef8c6cd3847f29b44f1.js:5862:60)
    at Module.../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@1.3.1/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/changing-window/count-events-for-safari.js (/tmp/tmp-3745-MUv3E5mw4c2K/assets/chunk.eef8c6cd3847f29b44f1.js:5941:3)
    at __webpack_require__ (/tmp/tmp-3745-MUv3E5mw4c2K/assets/chunk.e294b0957394a7e22a16.js:23:42)
    at Module.../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@1.3.1/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/changing-window/is-leaving-window.js (/tmp/tmp-3745-MUv3E5mw4c2K/assets/chunk.eef8c6cd3847f29b44f1.js:6058:82)
    at __webpack_require__ (/tmp/tmp-3745-MUv3E5mw4c2K/assets/chunk.e294b0957394a7e22a16.js:23:42)
    at Module.../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@1.3.1/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/ledger/lifecycle-manager.js (/tmp/tmp-3745-MUv3E5mw4c2K/assets/chunk.eef8c6cd3847f29b44f1.js:4622:97)
    at __webpack_require__ (/tmp/tmp-3745-MUv3E5mw4c2K/assets/chunk.e294b0957394a7e22a16.js:23:42)
    at Module.../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@1.3.1/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/make-adapter/make-adapter.js (/tmp/tmp-3745-MUv3E5mw4c2K/assets/chunk.eef8c6cd3847f29b44f1.js:5022:83)
    at __webpack_require__ (/tmp/tmp-3745-MUv3E5mw4c2K/assets/chunk.e294b0957394a7e22a16.js:23:42)
    at Module.../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@1.3.1/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/adapter/element-adapter.js (/tmp/tmp-3745-MUv3E5mw4c2K/assets/chunk.eef8c6cd3847f29b44f1.js:3414:84)
    at __webpack_require__ (/tmp/tmp-3745-MUv3E5mw4c2K/assets/chunk.e294b0957394a7e22a16.js:23:42)
    at Module.../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@1.3.1/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/entry-point/element/adapter.js (/tmp/tmp-3745-MUv3E5mw4c2K/assets/chunk.eef8c6cd3847f29b44f1.js:4011:82)
    at __webpack_require__ (/tmp/tmp-3745-MUv3E5mw4c2K/assets/chunk.e294b0957394a7e22a16.js:23:42)
    at Module.../../../../../node_modules/.pnpm/ember-draggable-modifiers@1.0.0_@babel+core@7.24.3_ember-source@5.4.1/node_modules/ember-draggable-modifiers/dist/modifiers/draggable-item.js (/tmp/tmp-3745-MUv3E5mw4c2K/assets/chunk.eef8c6cd3847f29b44f1.js:89124:107)

Perhaps we can add a simple fastboot guard in these modifiers so that components that use these modifiers can be rendered in fastboot as well.

alvarocastro commented 1 day ago

Thanks for reporting this issue.

I've never used fastboot so I have not much idea of what you are asking and might take a (long) while to address this.

Else feel free to open PR addressing this (and also I can check and learn from it)