Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArcGIS components causing issues with build #4

Closed
colbyhemond opened this issue Feb 23, 2022 · 6 comments
Closed

ArcGIS components causing issues with build #4

colbyhemond opened this issue Feb 23, 2022 · 6 comments

Comments

@colbyhemond
Copy link
Member

Currently the '@arcgis/core' is causing a build error. I have done a little research and it seems to be a common problem with packages that are not set up correctly with esm. see issue here. There seem to be ways to work around it, but not sure if it's worth it.

I'm curious if it would be better switching to a different map library like leaflet or svelte mapbox as they seem to do the same kind of thing we are doing with our map and they might be set up to work with sveltekit.

@ejolly
Copy link
Contributor

ejolly commented Feb 24, 2022

@colbyhemond Yea I've run into this on other svelte (not sveltekit) projects with different libraries and the work arounds usually aren't worth it.

I'm fine with switching to another library if that'll make development easier. I think the original motivation for ArcGIS was that we had existing state data (from ISPs) in an ArcGIS layer that we could also display in the app as needed. Maybe it's worth seeing if we can still visualize that using leaflet or mapbox? Or how hard it would be?

That'll might give us a sense of whether it's more work to twist ArcGIS to work with sveltekit or visualize existing data using another library

@colbyhemond
Copy link
Member Author

I'm currently trying out a couple different map solutions. and creating a couple different local branches to keep it all organized and clean. I'll update with findings after some research and testing

@ejolly
Copy link
Contributor

ejolly commented Mar 3, 2022

@colbyhemond It looks like https://ruralnetv2.herokuapp.com/results is causing a server error in the deployed version of the app. I didn't notice this when developing locally though. Not sure if this is related to the previous issue or has to do with the leaflet dynamic importing.

@colbyhemond
Copy link
Member Author

@ejolly it looks like it error is occurring somewhere in the initial load. I'm seeing that the endpoint variable in makeAuthenticatedReq() is undefined. I see you've added a few environment variables that I haven't seen yet. BACKEND_URL and BACKEND_AUTH. That might explain why it was working for you locally. Because even for me locally I am seeing the same server error that you can see on the deployed app.

@ejolly
Copy link
Contributor

ejolly commented Mar 4, 2022

Ah nice catch! So turns out my proposed solution in #7 doesn't actually work on the deployed app because the client can't read process.env. Might need to revisit later, but I disabled that for now and it seems to be working again!

@colbyhemond
Copy link
Member Author

Closing as we are using leaflet instead of ArcGIS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants