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.

No error during Develop. Lots of errors during Build

See original GitHub issue

Description

When using some vue packages I’m seeing that it works during development. When I try to build for a release it fails. I’ll use one of the dependent packages as an example.

Steps to reproduce

  1. npm install vue-custom-scrollbar
  2. make use of the component like this
  3. Run gridsome develop (it works)
  4. Run gridsome build (it fails)

Expected result

The project should build properly during development and build to keep suprises before a release to a minimum.

Actual result

Project fails when trying to build with error

ReferenceError: document is not defined

Environment

@gridsome/cli v0.0.9 gridsome v0.5.8

Browser:

  • Chrome (desktop)
  • Safari (desktop) version XX

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

12reactions
u12206050commented, Jul 14, 2019

Hi, you wrap i around the component. eg.

<template>
  <div>
    <ClientOnly>
      <vue-custom-scrollbar></vue-custom-scrollbar>
    </ClientOnly>
  </div>
</template>

<script>
// Don't import it here
export default {
  components: {
    vueCustomScrollbar: () => import('vue-custom-scrollbar') // Lazy load it in
  }
}
2reactions
FilledStackscommented, Jul 15, 2019

Much appreciated. This worked, definitely need some friendlier errors to indicate some errors 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Visual Studio displaying errors even if projects build
The fix was to Exclude the file from the project and save/build which produced an expected error and then Include the file in...
Read more >
No errors displayed in the "Error List" (error list doesn't show ...
Visual Studio 2017 Version 15.4.2 on Windows 7. I have a compiler error and my error list is empty. switching from "Build +...
Read more >
Project build errors and warnings (PRJxxxx)
The Visual Studio compilers and build tools can report many kinds of errors and warnings. After an error or warning is found, the...
Read more >
XCode 14 compile errors immediately disappear or do not ...
I'm unable to use XCode 14 to develop my app because as soon as a compiler error is shown, it is immediately withdrawn...
Read more >
Identify and Fix Build and Deployment Errors in Your ...
This error is seen a lot because it can occur due to a variety of factors. This error occurs most commonly within your...
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