Skip to content
This repository was archived by the owner on Nov 26, 2021. It is now read-only.

integrating with vue-cli #430

Closed
jnal opened this issue Feb 20, 2018 · 5 comments
Closed

integrating with vue-cli #430

jnal opened this issue Feb 20, 2018 · 5 comments

Comments

@jnal
Copy link

jnal commented Feb 20, 2018

New to this stuff and will be needing help.

  • Vue.js version: 2.5.13

  • consumed using: vue-cli - webpack

  • FULL error message (including stack trace):
    Uncaught ReferenceError: process is not defined
    at eval (utils.js?bc36:3)
    at Object../node_modules/micromatch/lib/utils.js (app.js:2740)
    at webpack_require (app.js:679)
    at fn (app.js:89)
    at eval (expand.js?58f9:10)
    at Object../node_modules/micromatch/lib/expand.js (app.js:2724)
    at webpack_require (app.js:679)
    at fn (app.js:89)
    at eval (index.js?7fb9:10)
    at Object../node_modules/micromatch/index.js (app.js:2708)

  • relevant code:

<template>
 <v-server-table :columns="['CreatedDate', 'AdminActivityName', 'CreatedBy', 'Changes']" />
</template>

<script>
    import Vue from 'vue'
    import { ServerTable } from 'vue-tables-2';
</script>

  • steps for reproducing the issue:
  1. created a new project from vue cli using default webpack template
  2. npm install vue-tables-2
  3. imported Server table from the .vue file and received the error.
@mykeels
Copy link

mykeels commented Feb 27, 2018

Looks like this might help @jnal https://stackoverflow.com/a/41359607/7396801

@clementvp
Copy link

Looks this issue is relative with vue-cli v3. I have the same issue with the v3 (In beta) but not in v2.
Same error message for me in v3 process is not defined.
@jnal did you figured out ? If yes can you explain how :) (I tried to manipulate vue.config.js but it's tricky)

@vesper8
Copy link

vesper8 commented Mar 3, 2018

Am also having this issue, also on a project using vue-cli 3 (beta.2)

I tried the solution from the SO above. In my vue.config.js added

const webpack = require('webpack');

module.exports = {
  lintOnSave: true,
  dll: true,
  configureWebpack: {
    plugins: [
      new webpack.DefinePlugin({
        'process.env.NODE_ENV': JSON.stringify('development'),
      }),
    ],
  },
};

But that doesn't fix the error:

screenshot 2018-03-03 15 38 13

By the way, the same problem occurs if you try to use the client table, so it's not exclusive to the server table

It is literally the addition of this line that triggers the error

import { ClientTable } from 'vue-tables-2';

even without the

Vue.use(ClientTable, {}, true, 'bootstrap3', 'default');

The error occurs if the import is used

@vesper8
Copy link

vesper8 commented Mar 3, 2018

I just found a workaround, see my comment here vuejs/vue-cli#934 (comment)

@vesper8
Copy link

vesper8 commented Mar 4, 2018

Evan just fixed it :) So that means once v3.beta.4 is tagged the workaround won't be needed anymore

@matfish2 matfish2 closed this as completed Mar 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants