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

Module not found: Can't resolve 'lodash.throttle' #584

Open
ackle-dev opened this issue Feb 9, 2025 · 0 comments
Open

Module not found: Can't resolve 'lodash.throttle' #584

ackle-dev opened this issue Feb 9, 2025 · 0 comments

Comments

@ackle-dev
Copy link

Next throws an error about not being able to find lodash.throttle. I've tried installing that package manually, but the same thing happens.
Steps to reproduce: create a quick Next app with react-scroll and use the Link component and scrollSpy function appropriately.

Next.js logs:

⨯ ./node_modules/react-scroll/modules/mixins/scroll-spy.js:7:1
Module not found: Can't resolve 'lodash.throttle'
   5 | });
   6 |
>  7 | var _lodash = require('lodash.throttle');
     | ^
   8 |
   9 | var _lodash2 = _interopRequireDefault(_lodash);
  10 |

https://nextjs.org/docs/messages/module-not-found

Import trace for requested module:
./node_modules/react-scroll/modules/index.js
./src/components/scroll/ScrollLink.tsx
./src/app/page.tsx

tsconfig.json:

{
	"compilerOptions": {
		"lib": ["dom", "esnext"],
		"skipLibCheck": true,
		"strict": true,
		"noEmit": true,
		"esModuleInterop": true,
		"module": "esnext",
		"moduleResolution": "bundler",
		"resolveJsonModule": true,
		"isolatedModules": true,
		"jsx": "preserve",
		"incremental": true,
		"plugins": [
			{
				"name": "next"
			}
		],
		"paths": {
			"@/*": ["./src/*"],
			"@ui/*": ["./src/components/ui/*"]
		},
		"target": "esnext"
	},
	"include": [
		"next-env.d.ts",
		"**/*.ts",
		"**/*.tsx",
		".next/types/**/*.ts",
		"next.config.js"
	],
	"exclude": ["node_modules"]
}
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