Open MiloGeimer opened 1 year ago
"Failed to import model.(TypeError: Failed to fetch)"
pleas use one of three templates for issues. i just filled in bug template in your initial comment, please edit it to fill it out.
Same problem is happening to me,im at Nextcloud 26.0.0 I installed the app via App Store
Just wont load any FBX
well, the bugreport quality... I have no idea about any of the required info that OP @MiloGeimer failed to fill, except
anyways, I just checked some models. i can replicate issues with FBX, that has embedded textures. for example this fbx works (no textures). does the FBX in the link work for @MiloGeimer and @Altair1231?
it seems that it is upstream issu that I will attend at some point.
Hi, I have the same issue and using the mentioned FBX file still can't be previewed.
From browser console logs, it seems CSP is blocking blob:
when previewing the FBX file.
Refused to connect to 'blob:https://example.com/acda3f2d-c3ab-4855-b334-95ebc0af36fa' because it violates the following Content Security Policy directive: "connect-src 'self'".
Instance info:
Nextcloud 27 docker (nextcloud with apache built-in docker image
nextcloud:latest
with Caddy as reverse proxy)
Via app store
@MiloGeimer, @Altair1231 can you please try 0.0.11.
if it fails, please provide link to exact FBX file that it fails for.
@DevinWinata Refused to connect to 'blob:https://example.com/acda3f2d-c3ab-4855-b334-95ebc0af36fa' because it violates the following Content Security Policy directive: "connect-src 'self'".
is unrelated, IMHO the issue lies somewhere else in your case.
failed to import model typeerror: failed to fetch (3D Model Viewer app) files_3dmodelviewer.js?v=13e99c0e-57:1 Refused to connect to 'blob:https://????????/cffe6d08-6aab-48ea-a13c-6bac1da49555' because it violates the following Content Security Policy directive: "connect-src 'self'". Help me!!!
I have encountered the same issue and it seems like the csp is actually to blame, since other models load just fine. when they aren't loaded via blob.
@DerLeole @DevinWinata @MiloGeimer @ivan4os Could you use the "Developer Tools" from your browser (Google Chrome ?), load the NexCloud page, go in "network" tab, and give the whole content of "Content-Security-policy" ?
@smarinier here's CSP from my nextcloud instance
default-src 'none';base-uri 'none';manifest-src 'self';script-src 'nonce-RkU3OVZiR0t5aWpYZ0tJa3E5bm9pRE5PZmM2Y2RVZWRMalJWTTFZSTNkWT06ZlNQSU9Ndk1uMStGNmZaOW5PNkV6SDhoUEpuTU9pLzRWRkFpZVNaaTlvND0=' 'self' drive.example.com 'unsafe-eval';script-src-elem 'strict-dynamic' 'nonce-RkU3OVZiR0t5aWpYZ0tJa3E5bm9pRE5PZmM2Y2RVZWRMalJWTTFZSTNkWT06ZlNQSU9Ndk1uMStGNmZaOW5PNkV6SDhoUEpuTU9pLzRWRkFpZVNaaTlvND0=' 'self' drive.example.com 'unsafe-eval';style-src 'self' 'unsafe-inline';img-src 'self' data: blob: * https://*.tile.openstreetmap.org https://office.example.com;font-src 'self' data:;connect-src 'self';media-src 'self';frame-src 'self' nc: https://office.example.com;frame-ancestors 'self' https://office.example.com;worker-src 'self';form-action 'self' https://office.example.com
@DevinWinata could you try to (temporarily) install and active the "Talk" application in NextCloud. And tell me if it's ok now for the FBX preview ?
@smarinier hi, it's now able to preview FBX files.
Ok. I see what the fix could be.
Hi @kroko,
Could you have a look on the very simple PR #26 ?
Thanks
@smarinier merged and pushed as a new release v0.0.14 in NC appstore, thanks! wait till it lands and test it out. while first getting this plugin up and running CSP was headache, especially because for some file type loaders it has to lazyload extra js and wasm however based on what plugins user has installed (i specially installed A LOT in the dev instance) the whole CSP policy goes haywire.
Describe the bug
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I have checked that the files are not corrupted
Yes, file is working when I open it in...
Screenshots
Browser log
How to access your browser console (Click to expand)
### Chrome 1. Press either CTRL + SHIFT + I / CMD + ALT + I or F12 to open the Developer Tools. 2. Click the “console” tab. ### Safari 1. Press CMD + ALT + I to open the Web Inspector. 2. See Chrome’s step 2. (Chrome and Safari have pretty much identical dev tools.) ### IE 1. Press F12 to open the developer tools. 2. Click the “console” tab. ### Firefox 1. Press CTRL + SHIFT + K to open the Web console (COMMAND + SHIFT + K on Macs). 2. or, if Firebug is installed (recommended): 1. Press F12 to open Firebug. 2. Click on the “console” tab. ### Opera 1. Press CTRL + SHIFT + I to open Dragonfly. 2. Click on the “console” tab.Installation and configuration
How the app was installed?
files_3dmodelviewer.tar.gz
from releases and unzipping the directory.App server configuration Parameters
apps_path
parameter is not explicitly configured/customised inconfig/config.php
Versions
3D Model Viewer
Nextcloud
Desktop
Handheld
Additional context