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.

Vue.js variable __VUE_SSR_CONTEXT__ is undeclared

See original GitHub issue

Got a error. After add jscomp_off: “checkVars” option, vuejs died with erorr: TypeError: a is undefined.

ERROR in app.js from Closure Compiler
The compiler is waiting for input via stdin.
stdin:127: ERROR - variable __VUE_SSR_CONTEXT__ is undeclared
      if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
                             ^^^^^^^^^^^^^^^^^^^

stdin:1044: ERROR - variable WXEnvironment is undeclared
var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
                    ^^^^^^^^^^^^^

stdin:2428: ERROR - variable Proxy is undeclared
    typeof Proxy !== 'undefined' &&
           ^^^^^

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:1
  • Comments:14 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
MatrixFrogcommented, Mar 21, 2018

See https://developers.google.com/closure/compiler/docs/api-tutorial3#externs

It doesn’t need to be defined – it just needs to be declared in an externs file which tells the compiler that it might exist (and what type it will have in the event that it does exist). In this case all you need (at least to get rid of the errors reported here) is a file custom-externs.js:

/**
 * @fileoverview
 * @externs
 */

var __VUE_SSR_CONTEXT__;
var WXEnvironment;

and then pass --externs=custom-externs.js on the compiler command line. Hopefully that makes sense? If not let us know.

0reactions
ChadKillingsworthcommented, Mar 21, 2018

Make sure you are using webpack 3.x

Read more comments on GitHub >

github_iconTop Results From Across the Web

Recommended - SlideShare
Env Variables and Modes Env Variables Vite exposes env variables ... Migration from v2 Node.js Support Vite no longer supports Node.js 12 /....
Read more >
Download Diff File
diff --git a/vuepress-next-main/.commitlintrc.js b/vuepress-next-main/.commitlintrc.js ... +* **theme-default:** add more palette variables for code styles ...
Read more >
Build a front-end SSR enterprise project with koa2 + vite + TS ...
The simple understanding is html It is written by the server , You can dynamically change the page content , The so-called dynamic...
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