Comments (10)
upstream issue goes from flexsearch
lock working version in your package.json, example with pnpm
"pnpm": {
"overrides": {
"flexsearch": "0.7.31"
}
}
from nextra.
this issue was fixed in [email protected]
from nextra.
In my case, with yarn. This works.
"resolutions": {
"flexsearch": "0.7.31"
},
@dimaMachina thank you :)
from nextra.
upstream issue goes from flexsearch
lock working version in your package.json, example with pnpm
"pnpm": { "overrides": { "flexsearch": "0.7.31" } }
Just to append to that,
That pnpm
override should be in the root package.json
if you're in a monorepo.
from nextra.
Update: I was able to get the site I had errors with running by clean-installing with pnpm
instead of using npm
.
Just ran into the same problem as well and have tried across various starter Nextra
apps and development environments(on GitHub Codespaces, on a Mac computer, on a Windows computer, etc)
My Next.js error screen is saying(here's the Nextra site I'm trying):
./node_modules/nextra-theme-docs/dist/index.js:535:0
Module not found: Can't resolve 'flexsearch'
https://nextjs.org/docs/messages/module-not-found
Import trace for requested module:
./pages/index.mdx
I just created a brand new next.js project via
pnpx create-next-app@latest
, using the pages router (not app router), installed nextra with the docs theme and am getting an error resolving the flexsearch module. Is there something I'm doing wrong?⨯ ../../node_modules/.pnpm/[email protected][email protected][email protected][email protected][email protected]/node_modules/nextra-theme-docs/dist/index.js:535:0 Module not found: Can't resolve 'flexsearch'
from nextra.
[Updated] my local env showed error after clean .next, node_modules but also on the vercel.
It works fine on my local env, but not on the vercel.
Nothing changed related documents but the error showed for the past 8 hours.
this is vercel compile log.
Running build in Washington, D.C., USA (East) – iad1
--
11:35:51.323 | Cloning github.com/...
11:35:51.333 | VERCEL_FORCE_NO_BUILD_CACHE is set so skipping build cache step
11:35:54.885 | Cloning completed: 3.562s
11:35:55.693 | Running "vercel build"
11:35:56.213 | Vercel CLI 33.0.2
11:35:56.623 | Installing dependencies...
11:35:56.961 | yarn install v1.22.17
11:35:57.000 | info No lockfile found.
11:35:57.005 | [1/4] Resolving packages...
11:36:08.636 | [2/4] Fetching packages...
11:36:42.565 | [3/4] Linking dependencies...
11:36:42.570 | warning " > @monaco-editor/[email protected]" has unmet peer dependency "monaco-editor@>= 0.25.0 < 1".
11:36:42.570 | warning "@monaco-editor/react > @monaco-editor/[email protected]" has unmet peer dependency "monaco-editor@>= 0.21.0 < 1".
11:36:42.587 | warning Workspaces can only be enabled in private projects.
11:36:52.860 | [4/4] Building fresh packages...
11:36:53.072 | success Saved lockfile.
11:36:53.076 | Done in 56.12s.
11:36:53.128 | Detected Next.js version: 13.5.6
11:36:53.130 | Running "yarn run build"
11:36:53.324 | yarn run v1.22.17
11:36:53.359 | $ next build
11:36:54.078 | Attention: Next.js now collects completely anonymous telemetry regarding usage.
11:36:54.079 | This information is used to shape Next.js' roadmap and prioritize features.
11:36:54.079 | You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
11:36:54.079 | https://nextjs.org/telemetry
11:36:54.080 |
11:36:54.188 | Linting and checking validity of types ...
11:36:58.507 | Creating an optimized production build ...
11:37:01.262 | [nextra] Found "_app.tsx" file, refactor it to "_app.mdx" for better performance.
11:37:02.762 | [nextra] Init git repository failed Discover git repo from [/vercel/path1] failed: could not find repository from '/vercel/path1'; class=Repository (6); code=NotFound (-3)
11:39:13.425 | Failed to compile.
11:39:13.425 |
11:39:13.425 | ./node_modules/nextra-theme-docs/dist/index.js
11:39:13.426 | Module not found: Can't resolve 'flexsearch'
11:39:13.426 |
11:39:13.426 | https://nextjs.org/docs/messages/module-not-found
11:39:13.426 |
11:39:13.426 | Import trace for requested module:
11:39:13.426 | ./pages/config/config.mdx
11:39:13.426 |
11:39:13.427 |
11:39:13.427 | > Build failed because of webpack errors
11:39:13.793 | error Command failed with exit code 1.
11:39:13.793 | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
11:39:13.814 | Error: Command "yarn run build" exited with 1
and a part of packages.json dependencies
"dependencies": {
"@emotion/react": "^11.11.1",
"@emotion/server": "^11.11.0",
"@mantine/core": "^6.0.19",
"@mantine/hooks": "^6.0.19",
"@mantine/next": "^6.0.19",
"@monaco-editor/react": "^4.5.2",
"@tabler/icons-react": "^2.34.0",
"@vercel/analytics": "^1.1.1",
"common-tags": "^1.8.2",
"next": "^13.4.19",
"nextra": "^2.12.3",
"nextra-theme-docs": "^2.12.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"tmp": "^0.2.1", ...
},
from nextra.
"pnpm": { "overrides": { "flexsearch": "0.7.31" } }
wow... it works me. thanks!!!
from nextra.
"pnpm": { "overrides": { "flexsearch": "0.7.31" } }wow... it works me. thanks!!!
This one does not work for me following the nextra-docs-template example.
from nextra.
Just adding on to the pile, my team was facing the same issue, and the frontend dev was able to make the build compile by reverting to an older version of flexsearch.
from nextra.
for those using bun,
"overrides": {
"flexsearch": "0.7.31"
}
from nextra.
Related Issues (20)
- React fails to recognize the prop named `fetchPriority`
- Adding multiple documentation. HOT 2
- Index navigation not updating but pages are
- How can I use Nextra's built-in search component? 🙏🙏
- How to prevent documents from being searched? HOT 3
- Feedback for “CSM.AI Documentation”
- Feedback for “Custom Theme”
- Small bug: if newWindow is false the menu item is constantly active
- Feedback for “Cards Component”
- Feedback for posts layout heading levels
- How to use PNG, IMG file as background image? and can I add some css to animate effect on page? HOT 2
- Different theme.config.jsx for different mdx pages HOT 1
- Supports syntax highlighting features in `*.md` files
- Found broken `/docs/brave-case-study` link. Please fix!
- Hide breadcrumb on summary pages
- Theme Configuration - 404/500 HOT 1
- the way I make it is like this HOT 1
- How can I override the `img`
- [BUG?] Every reload i get this error HOT 2
- Display sidebar for "page" type
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nextra.