Skip to content

import and call enableMapSet() error happens even after enableMapSet() is called. #1022

@github0013

Description

@github0013

To Reproduce

Steps to reproduce the behavior:

https://codesandbox.io/p/sandbox/thirsty-dan-4e3o9r

  1. Open and wait, and you will see the error.
  2. Notice enableMapSet() in the code, but the error says

The plugin for 'MapSet' has not been loaded into Immer. To enable the plugin, import and call enableMapSet() when initializing your application.

Change the version to 9.0.12, then restart. Now the error is gone.

Observed behavior

A description of what behavior you observed and why you consider it faulty.

  • The version on the codesandbox is immer@9.0.19, but this error doesn't happen if it was immer@9.0.12.
  • This happens under nextjs projects. If the same code is run under a regular react app, things work without an error.

Expected behavior

A clear and concise description of what you expected to happen instead.

  • immer@9.0.13 - 9.0.19 shouldn't not show the error.

Environment

We only accept bug reports against the latest Immer version.

  • Immer version:
  • I filed this report against the latest version of Immer
  • Occurs with setUseProxies(true)
  • Occurs with setUseProxies(false) (ES5 only)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions