question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

primary module does not work on the server

See original GitHub issue

The primary module referred to by main will not run on the server due to its reference to document.

I am building a universal application using Nuxt.js and this caused problems for us.

I am able to work around this by using an alias to re-point vue-svgicon at the source itself, which does not have any references to document.

This code seems perfectly capable of running in both environments. Looking at the build for this project I am not able to understand why webpack is adding references to document at all. I’m not sure what feature it is trying to provide for the library by doing so.

Please let me know if I can help further.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
corsen2000commented, Apr 25, 2017

@Ca4tkin config.resolve.alias['vue-svgicon$'] = 'vue-svgicon/component/svgicon.vue'; is what I am using in extend(config).

0reactions
wienskacommented, Apr 25, 2017

@corsen2000 , could you explain in detail how to make it work with Nuxt? Which alias should be changed?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Javascript module not working in browser? - Stack Overflow
Open a terminal. (On Windows: cmd.exe .) · Type npm and hit Enter to see if Node.js is installed. · Install live-server: npm...
Read more >
The specified module 'Module Name' was not loaded because ...
This error is because the PowerShell console or ISE is unable to get the module from given module path's in the environment variable...
Read more >
Storybook cannot be built on packages using "type": "module"
I'm not able to get this working with CRA. Node v12.18.4; @storybook/react v6.0.22; "type": "module" in package.json; renamed main ...
Read more >
Troubleshooting Management Module connectivity issues - IBM
How to troubleshoot management module connectivity issues.
Read more >
Powershell broke - basic commands not working, not loading ...
Hi, Check if $env:PSModulePath contains C:\Program Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1. 0\Modules. If not, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found