sanity-plugin-mapbox-input
sanity-plugin-mapbox-input copied to clipboard
TypeError: window.URL.createObjectURL is not a function
Hello!
I was hoping to use this in lieu of the Google Maps input. The studio is building fine and looks good but as soon as I run sanity graphql deploy I get this strange error:
TypeError: window.URL.createObjectURL is not a function
at define (~/coding/mindmapbc/sanity-studio/node_modules/mapbox-gl/dist/mapbox-gl.js:106:41)
at ~/coding/mindmapbc/sanity-studio/node_modules/mapbox-gl/dist/mapbox-gl.js:116:1
at ~/coding/mindmapbc/sanity-studio/node_modules/mapbox-gl/dist/mapbox-gl.js:84:81
at Object.<anonymous> (~/coding/mindmapbc/sanity-studio/node_modules/mapbox-gl/dist/mapbox-gl.js:87:2)
Which based on the googling that I have done seems to be something to do with mapbox and testing? See this issue:
https://github.com/mapbox/mapbox-gl-js/issues/3436
Here is my are my dependencies in case it helps:
"dependencies": {
"@sanity/base": "^2.0.7",
"@sanity/code-input": "^2.0.5",
"@sanity/color-input": "^2.0.5",
"@sanity/components": "^2.0.7",
"@sanity/core": "^2.0.5",
"@sanity/dashboard": "^2.0.5",
"@sanity/default-layout": "^2.0.7",
"@sanity/default-login": "^2.0.5",
"@sanity/desk-tool": "^2.0.8",
"prop-types": "^15.6",
"react": "^16.2",
"react-dom": "^16.2",
"react-icons": "^3.11.0",
"sanity-plugin-dashboard-widget-document-list": "^0.0.11",
"sanity-plugin-mapbox-input": "^0.0.3",
"sanity-plugin-media": "^0.4.0"
},
"devDependencies": {}
}
And sanity.json stuff
"plugins": [
"@sanity/dashboard",
"@sanity/base",
"@sanity/components",
"@sanity/default-layout",
"@sanity/default-login",
"@sanity/desk-tool",
"@sanity/color-input",
"@sanity/code-input",
"dashboard-widget-document-list",
"dashboard-widget-structure-menu",
"media",
"mapbox-input"
],
"parts": [
{
"name": "part:@sanity/base/schema",
"path": "./schemas/schema.js"
},
{
"name": "part:@sanity/desk-tool/structure",
"path": "./structure/deskStructure.js"
},
{
"implements": "part:@sanity/dashboard/config",
"path": "./dashboard/dashboardConfig.js"
}
]
I am also getting the same.
I just started getting the same. Any updates on this?
Same issue here
I just tried the plugin again on a fresh Sanity Studio install and it worked just fine, couldn't replicate this issue :/ I'm not sure where this comes from tbh!
I am also now getting this error when i try to run sanity graphql deploy
On Tue, 23 Mar 2021 at 5:45 PM Bryce Flory @.***> wrote:
I am also now getting this error when i try to run sanity graphql deploy
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Grsmto/sanity-plugin-mapbox-input/issues/5#issuecomment-804914794, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOFELEQKG5PU7ROGFWYUIFTTFCLOLANCNFSM4TGJREHQ .
Hi All,
This something like we are trying to access frontend objects in the server side.
We need to add a condition telling like if windows object is present then only we can use this object.
Please let me know if any help is needed specifically to this issue I am happy to help.
I got the same error, and was able to establish that the inclusion of @sanity/color-input is what caused it (the commit right before the one that introduced it did not trow the error).
Anyone knows how to circumvent this? We need the input, but we also need to deploy the dataset! 😅
Fingers crossed that the mapbox-gl-js team will approve my PR and solve this issue! 🤞
This error should go away now that mapbox-gl-js has released the change on their v2.7.0. 🎉
https://github.com/mapbox/mapbox-gl-js/releases/tag/v2.7.0.
The fix here is to get the dependency that uses mapbox-gl-js to point to the new version.
Hmmm some dep somewhere hasn't been bumped yet - still seeing this on a fresh install 🤔