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

Webpack 5 error #58

Open
twelch opened this issue Apr 26, 2021 · 3 comments
Open

Webpack 5 error #58

twelch opened this issue Apr 26, 2021 · 3 comments

Comments

@twelch
Copy link
Contributor

twelch commented Apr 26, 2021

Upgrading dependencies to webpack 5, as attempted in this PR, causes a runtime error in React with "Context not set" after giving the message to run the area function.

Reproduce:

Storybook still being on webpack 4 doesn't appear to be the issue but that is the case. Until we have a pressing need to upgrade to webpack 5 we may want to wait for this to resolve - storybookjs/storybook#9216

@twelch
Copy link
Contributor Author

twelch commented Apr 26, 2021

I did a bisecting process to determine the last good commit that the Client would run a function and display the results properly was 02a03a6.

I created a branch off of dev at the next breaking commit a5d5ab - https://github.com/seasketch/geoprocessing/tree/a5-fun. Then, I rolled back the dependency upgrades and then with a run start:client I was able to successfully load an Area client. Bumping the versions again, I could reproduce the context not set error.

window.postMessage({
    "type": "SeaSketchReportingMessageEventType",
    "client": "Area",
    "geometryUri": "https://www.seasketch.org/geojson/607f3953a967192577003534",
    "sketchProperties": {
        "id": "607f3953a967192577003534",
        "name": "Test Example Project",
        "createdAt": "2021-04-20T20:28:03.607Z",
        "updatedAt": "2021-04-20T20:28:03.607Z",
        "sketchClassId": "5edfa3a8a1a9956b48ece131",
        "isCollection": false,
        "userAttributes": [],
        "visibleLayers": []
    }
})

@twelch
Copy link
Contributor Author

twelch commented May 14, 2021

Once webpack 5 comes, these other dependencies left behind can be upgraded - #27

@twelch
Copy link
Contributor Author

twelch commented Feb 3, 2022

storybook is stuck on webpack 4 for now, it probably won't change until its next breaking major release (v7) where it may support multiple transpilers. anyway storybook can probably be isolated ot use v4 while the rest of the stack uses webpack 5 if that's useful.

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

No branches or pull requests

1 participant