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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

lazy typescript definition missing options argument: Expected 1 argument, but got 2 #958

Open
viveleroi opened this issue Mar 4, 2023 · 2 comments
Labels

Comments

@viveleroi
Copy link

馃悰 Bug Report

I've switched a loadable code to lazy so that I can use react suspense, per your website docs.

While everything still works, typescript is throwing an error that lazy only accepts one argument.

Error: Expected 1 argument, but got 2

To Reproduce

const Component = lazy(
  () =>
    pMinDelay(
      import(`./modules/${module.folderName}/${submodule.folderName}/${submodule.folderName}.tsx`),
      200
    ),
  {
    resolveComponent: components => components[submodule.componentName]
  }
)

Expected behavior

No typescript errors.

Run npx envinfo --system --binaries --npmPackages @loadable/component,@loadable/server,@loadable/webpack-plugin,@loadable/babel-plugin --markdown --clipboard

Paste the results here:

## System:
 - OS: Windows 10 10.0.22000
 - CPU: (16) x64 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz
 - Memory: 14.79 GB / 31.73 GB
## Binaries:
 - Node: 18.9.1 - C:\Program Files\nodejs\node.EXE
 - Yarn: 3.3.1 - C:\Program Files\nodejs\yarn.CMD
 - npm: 8.19.1 - C:\Program Files\nodejs\npm.CMD
## npmPackages:
 - @loadable/component: ^5.15.3 => 5.15.3 
@stale
Copy link

stale bot commented Jun 18, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jun 18, 2023
@viveleroi
Copy link
Author

Not stale, needs to be addressed

@theKashey theKashey added bug and removed wontfix labels Jun 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants