-
Notifications
You must be signed in to change notification settings - Fork 67
Error during next build: Self-reference dependency has unused export name #34
Comments
Hi @Jshanks21, interesting. When you say that it's a "dynamic route created when users upload videos", what do you mean? Do you have a page with dynamic routing (e.g., Perhaps you can create either a minimal repo or at least share the relevant code snippets (i.e., what happens after video upload and what is the code for the page that should show the video)? If your work is open source, I am also happy to have a look at it directly. We will definitely figure this out! 💪 |
Hey @Jshanks21, is this still relevant? I'm happy to help! ❤️ Otherwise, I'll close it for now (and we can reopen if need be). |
Hi @FinnWoelm, So sorry for the delay in my response! We were able to get it working again by switching from netlify to vercel. That said, your solution may also have solved our issue. But this was the quickest solution we were able to find at the time. I'm still fairly new to Next.js and joined this project after a lot of the server side stuff was already set up, so there are probably a lot of places we could be optimizing Next better. But we have some expectations for an MVP soon that have limited our time to do this. The project is currently open-source and below is the commit tag from when we had next-on-netlify integrated: There's kind of a lot going on in this repo atm 😅. But any feedback is greatly appreciated! Otherwise, we were able to troubleshoot the error by switching to vercel and I'm sure you're busy so feel free to close the issue. Thank you in either case! |
Hey @Jshanks21, I'm sorry that it did not work on Netlify, but I'm glad you got it to work on Vercel 😊 I spent a few hours looking into it. The error actually occurs during After manually enabling and disabling the various package one by one, I was able to narrow the issue down to Anyway — we can work around that. We just need to take advantage of NextJS dynamic import to only load those packages on the client: import dynamic from "next/dynamic";
const ClientOnlyComponent = dynamic(() => import("./ClientOnlyComponent"), { ssr: false });
export default function MyComponent() (
<div>
<ClientOnlyComponent />
</div>
) This works (I only did it for the Index page, for this example). You can see it here: https://issue34-famegoods.netlify.app/ Code: https://github.com/FinnWoelm/famegoods This is the relevant commit: FinnWoelm/famegoods@577a97f Unfortunately, this approach does require some refactoring in order to isolate and dynamically import all those components that rely on 3box. Given your time crunch, I agree with your decision to stick to Vercel for now! I'm going to close this for now, but if you want to switch at some later point, always happy to help! 🙂 Happy hacking and best of luck with that MVP 🔥 |
Hello, my team currently has a project that's using Netlify to host the production build. However, we've been been getting 404 errors when trying to access the content (it's a dynamic route created when users upload videos.)
We were trying to use next-on-netlify to troubleshoot this issue, but after modifying the config files and updating the build we began receiving this error:
3:46:04 PM: ./node_modules/dom-helpers/cjs/addClass.js
3:46:04 PM: Self-reference dependency has unused export name: This should not happen
This was after receiving several unresolved dependency errors and adding them in an attempt to meet the dependency needs. We're trying to push this project into production soon, but our core issue has ultimately been rendering these dynamic content pages on netlify properly.
Happy to provide more details in an attempt to solve this error.
The text was updated successfully, but these errors were encountered: