Repository consola

tim-yao

tim-yao posted a new bug report

consola • 3 months ago

bug ci-info module throw error for "process is not defined"

Version

1.3.0

Reproduction link

https://codepen.io/timyaodpc/pen/bMyazm

Steps to reproduce

Use it in Nuxt/plugins/myplugin.js.

It all works but in browser console it give me a error says "process is not defined". Error points to "ci-info" module first line which tries to use process.env.

I can see ci-info is a dependency of consola as below:

└─┬ [email protected]
└─┬ [email protected]
└─┬ [email protected]
└── [email protected]

I now have to add isServer condition on const consola = require('consola'). Otherwise it breaks the client side.

What is expected ?

Browser should no error in console.

What is actually happening?

A error from ci-info says "process is not defined".

index.js:3 Uncaught ReferenceError: process is not defined
at Object../nodemodules/ci-info/index.js (index.js:3) at webpackrequire (bootstrap 20212f6dd5b287d60bc9:712)
at fn (bootstrap 20212f6dd5b287d60bc9:117)
at Object../nodemodules/is-ci/index.js (index.js:3) at webpackrequire (bootstrap 20212f6dd5b287d60bc9:712)
at fn (bootstrap 20212f6dd5b287d60bc9:117)
at Object.<anonymous> (index.js:1)
at Object../nodemodules/std-env/index.js (index.js:18) at webpackrequire (bootstrap 20212f6dd5b287d60bc9:712)
at fn (bootstrap 20212f6dd5b287d60bc9:117)

Additional comments?

Is Consola can only be used in server side js?
The consola code index.js first line imported std-env which can only used in server side.
https://github.com/nuxt/consola/blob/master/src/index.js#L1
Not sure which is the best way to use it in Nuxt and maybe it's a bug?

nikolaynesov

nikolaynesov posted a new question

consola • 3 months ago

Please remove the issue

Please remove it

hqqxxf

hqqxxf posted a new bug report

consola • 3 months ago

bug The page returned to the home page on wechat

Version

1.4.0

Reproduction link

https://jsfiddle.net/hqqxxf/edLsh8sL/

Steps to reproduce

in router '/a', it has a link to '/b', when I returned in '/b', The page returned to the home page('/') , and I found not the static resources request when returned.

What is expected ?

returned to the last page(router '/a')

What is actually happening?

returned to the home page(router '/' or 404)

ujjwalguptaofficial

ujjwalguptaofficial posted a new question

consola • 3 months ago

override route based on the pages folder

Let say In pages folder I have two folder - temp1 and temp2. So url will be -

"localhost/temp1/" and "localhost/temp2/ "

I want to overload url for temp2 folder and make it like - "localhost/" . I mean make it like the content of temp2 folder is in root

chenfangyi931

chenfangyi931 posted a new question

consola • 3 months ago

The vuex state can not be modified within the Axios interceptor

TIM截图20180506183037.png

kuangyazhou

kuangyazhou posted a new question

consola • 4 months ago

asyncData how to send multi request

in my code

async asyncData(){
const [a,b]=await Promise.all( await axios.get('/api/users'), await axios.get('/api/list') )
return {
users:a,
list:b,
}
}

why this mehtod not work ??
In my view ,i won't get the data users and list

what is the right writing

Jeromearsene

Jeromearsene posted a new question

consola • 4 months ago

Object is undefined if not stringified (JSON.stringify)

I have an object to log.

I do this:

    console.log(professionnalInfos);
    logger.info(professionnalInfos);
    logger.info(JSON.stringify(professionnalInfos));

Result:

{ siren: '1111111', phone: '0511111111' }
ℹ info undefined
ℹ info {"siren":"1111111","phone":"0511111111"}

I think undefined is counter intuitive. No ?

kuangyazhou

kuangyazhou posted a new question

consola • 4 months ago

how can i debugger my code in development

now ,i'm useing the nuxt-express templte 。in chrome ,i open the network ,how can I debugger my code by the method set point

Jeromearsene

Jeromearsene posted a new question

consola • 4 months ago

Problem error log color invisible

With my iterm configuration, I have this problem:
capture d ecran 2018-05-03 a 11 01 05

Error's details exist. If I select details, you can see this:
capture d ecran 2018-05-03 a 11 01 19

An idea for custom color ? Or other idea who can help me.

Thank you

Extarys

Extarys posted a new question

consola • 4 months ago

How can I access the innerText property of an element inside a component?

EDIT: Definitely not the right category, should be in Nuxt not consola. Sorry.

I'm trying to make a div with contenteditable and I need to set the innerText property. (I saw something on a chinese website, said it works)

My editable.vue component:

<template>
  <div
    contenteditable="true"
    @input="update"></div>
</template>
<script>
export default {
    props: {
        content: {
            type: String,
            default: '',
        },
    },
    mounted: () => {
        this.$el.innerText = this.content;
    },
    methods: {
        update (event) {
            this.$emit('update', event.target.innerText);
        },
    },
};
</script>

I'm calling it with <editable @update="editableRaw = $event"></editable>

I need a div to include emoji based on images, since most browsers don't support the latest always and I want it to be uniform.

Hope someone can enlighten me.
Cheers

acaxon

acaxon posted a new question

consola • 4 months ago

How can I pass a class (ES6) to a module?

In my Nuxt application I created a folder called models, and inside it I have some js files, each one defining a class that extends MyModel - a base class that is defined in an external module - my-module.

In nuxt.config.js I have:


modules: [
'my-module/nuxt'
],

I need to pass these extended classes to that module. How can I do this?

Thanks in advance.

pontakornth

pontakornth posted a new question

consola • 4 months ago

Vuex state is disappeared when route changed

Why Vuex state disappear whenever I change routes. My state is an array that contain blog posts. It works fine when I added post in index page using actions. Initial state is array of single post with ID of 0 like this [{id:0,title:"Problem is",content:"here"}], actions works and the array is pushed.

But when I change route the state is reversed to initial state again.

Heziode

Heziode resolved the question #c19

consola • 4 months ago

Generation Error: Cannot detect env, something went wrong!

The problem seems be solved by adding mode: 'spa' into nuxt.config.js

juppdes

juppdes posted a new bug report

consola • 4 months ago

bug [edge] css file´s path builded wrong

Version

Edge

Reproduction link

https://jsfiddle.net/Jupp/adnsv7ef/3/

Steps to reproduce

The background file set in the css is searched at 'http://localhost:3333/static/any.jpg', when it should be searched at 'http://localhost:3333/_nuxt/img/any.jpg'

What is expected ?

That point correctly to the files set in css classes.

What is actually happening?

I think they are looking for the wrong place.

Heziode

Heziode posted a new question

consola • 4 months ago

Generation Error: Cannot detect env, something went wrong!

Hi, when I try to generate static site, I get this error: "Error: Cannot detect env, something went wrong!"

yarn run generate
yarn run v1.6.0
$ nuxt generate
  nuxt:generate Generating... +0ms
  nuxt:build App root: FOE/foe-tools_V2 +0ms
  nuxt:build Generating FOE/foe-tools_V2/.nuxt files... +0ms
  nuxt:build Generating files... +11ms
  nuxt:build Generating routes... +35ms
  nuxt:build Building files... +49ms
  ████████████████████ 100% 

Build completed in 25.529s



 WARNING  Compiled with 1 warnings                                            02:28:05

 warning  

asset size limit: The following asset(s) exceed the recommended size limit (300 kB).
This can impact web performance.
Assets: 
  pages/gb-statistics.bcd8ddc88801f8ad587d.js (461 kB)
  pages/_root/gb-statistics/index.e336a94a36ec7db6e379.js (461 kB)
  pages/_root/gb-statistics/script.7d70a27517666c7ec160.js (454 kB)
  vendor.cceecb3e551f4fabeb44.js (442 kB)
  app.4910bd7a19744598e419.js (316 kB)

Hash: 4ea10b662f86cdce7c57
Version: webpack 3.11.0
Time: 25535ms
                                                     Asset       Size  Chunks                    Chunk Names
           layouts/_default/script.37f72315177a6d69e96b.js    4.23 kB      16  [emitted]         layouts/_default/script
                   pages/changelog.e07cab1bd7bc3f814013.js     124 kB    0, 1  [emitted]         pages/changelog
      pages/_root/changelog/script.65c5c23a90f2de3ecde1.js     123 kB       2  [emitted]         pages/_root/changelog/script
               pages/gb-statistics.bcd8ddc88801f8ad587d.js     461 kB    3, 4  [emitted]  [big]  pages/gb-statistics
   pages/_root/gb-statistics/index.e336a94a36ec7db6e379.js     461 kB       4  [emitted]  [big]  pages/_root/gb-statistics/index
  pages/_root/gb-statistics/script.7d70a27517666c7ec160.js     454 kB       5  [emitted]  [big]  pages/_root/gb-statistics/script
     pages/gb-investment/_gb/index.816e261a27ff58435a36.js    59.2 kB       6  [emitted]         pages/gb-investment/_gb/index
    pages/gb-investment/_gb/script.6fe76ae5b5f16ce41e6a.js    58.8 kB       7  [emitted]         pages/gb-investment/_gb/script
                   layouts/default.a93d2a55540ae08d9e7a.js     165 kB    8, 9  [emitted]         layouts/default
            layouts/_default/index.2705bf27b1459994a905.js     165 kB       9  [emitted]         layouts/_default/index
             pages/secure-position.552cdeb18e55b166be71.js    10.6 kB  10, 11  [emitted]         pages/secure-position
 pages/_root/secure-position/index.45d456cc0d38c605591f.js    10.3 kB      11  [emitted]         pages/_root/secure-position/index
               pages/cf-calculator.b3594828faf533013d3e.js    17.8 kB  12, 17  [emitted]         pages/cf-calculator
                       pages/index.0d2c5e46beb58f0f7171.js    1.87 kB  13, 20  [emitted]         pages/index
                pages/contributors.6dd30851422e440e45de.js    3.68 kB  14, 21  [emitted]         pages/contributors
                       pages/about.f9f3fa179314f39f0f24.js    2.04 kB  15, 22  [emitted]         pages/about
       pages/_root/changelog/index.724d516410a6a5e3ba67.js     123 kB       1  [emitted]         pages/_root/changelog/index
   pages/_root/cf-calculator/index.fa405889e367623a1def.js    17.5 kB      17  [emitted]         pages/_root/cf-calculator/index
         pages/gb-investment/index.47e1345d6f69ba85e3a5.js    34.3 kB      18  [emitted]         pages/gb-investment/index
pages/_root/secure-position/script.e9f6c6040e0338e713ce.js    9.94 kB      19  [emitted]         pages/_root/secure-position/script
            pages/_root/home/index.af5662f0aa052a3577cd.js    1.61 kB      20  [emitted]         pages/_root/home/index
    pages/_root/contributors/index.ee2b1ddbe6c670ea946f.js    3.41 kB      21  [emitted]         pages/_root/contributors/index
           pages/_root/about/index.98789df8a402517d1a96.js    1.78 kB      22  [emitted]         pages/_root/about/index
        pages/gb-investment/script.b3a7b95b81bbaaa212a1.js    33.4 kB      23  [emitted]         pages/gb-investment/script
  pages/_root/cf-calculator/script.1e7be91bd8a2fa54addc.js    8.98 kB      24  [emitted]         pages/_root/cf-calculator/script
           pages/_root/home/script.83a64a5e91da46f91d87.js  788 bytes      25  [emitted]         pages/_root/home/script
   pages/_root/contributors/script.fb592aca202be31e1999.js  873 bytes      26  [emitted]         pages/_root/contributors/script
          pages/_root/about/script.6c55ce9365dc6268b272.js  319 bytes      27  [emitted]         pages/_root/about/script
             layouts/_error/script.fe9d38506427f2ac22d6.js  763 bytes      28  [emitted]         layouts/_error/script
                            vendor.cceecb3e551f4fabeb44.js     442 kB      29  [emitted]  [big]  vendor
                               app.4910bd7a19744598e419.js     316 kB      30  [emitted]  [big]  app
                          manifest.4ea10b662f86cdce7c57.js       3 kB      31  [emitted]         manifest
                                                  LICENSES    5.22 kB          [emitted]         
 + 3 hidden assets

WARNING in asset size limit: The following asset(s) exceed the recommended size limit (300 kB).
This can impact web performance.
Assets: 
  pages/gb-statistics.bcd8ddc88801f8ad587d.js (461 kB)
  pages/_root/gb-statistics/index.e336a94a36ec7db6e379.js (461 kB)
  pages/_root/gb-statistics/script.7d70a27517666c7ec160.js (454 kB)
  vendor.cceecb3e551f4fabeb44.js (442 kB)
  app.4910bd7a19744598e419.js (316 kB)
Hash: 58ddd684a04d05137b9b
Version: webpack 3.11.0
Time: 4164ms
             Asset     Size  Chunks             Chunk Names
server-bundle.json  1.76 MB          [emitted]  
  nuxt: Call generate:distRemoved hooks (1) +0ms
  nuxt:generate Destination folder cleaned +30s
  nuxt: Call generate:distCopied hooks (1) +13ms
  nuxt:generate Static & build files copied +13ms
  nuxt:render Rendering url /secure-position +0ms
  nuxt:render Rendering url /about +105ms
  nuxt:render Rendering url /changelog +1ms
  nuxt:render Rendering url /contributors +1ms
  nuxt:render Rendering url /gb-statistics +1ms
  nuxt:render Rendering url /cf-calculator +4ms
  nuxt:render Rendering url /gb-investment +1ms
  nuxt:render Rendering url /gb-investment/script +4ms
  nuxt:render Rendering url / +3ms
  nuxt:render Rendering url / +112ms
  nuxt: Call generate:done hooks (1) +238ms
  nuxt:generate HTML Files generated in 30.4s +238ms

 Generate errors summary:

 ROUTE  /secure-position

  Error: Cannot detect env, something went wrong!

 ROUTE  /about

  Error: Cannot detect env, something went wrong!

 ROUTE  /changelog

  Error: Cannot detect env, something went wrong!

 ROUTE  /contributors

  Error: Cannot detect env, something went wrong!

 ROUTE  /gb-statistics

  Error: Cannot detect env, something went wrong!

 ROUTE  /cf-calculator

  Error: Cannot detect env, something went wrong!

 ROUTE  /gb-investment

  Error: Cannot detect env, something went wrong!

 ROUTE  /gb-investment/script

  Error: Cannot detect env, something went wrong!

 ROUTE  /

  Error: Cannot detect env, something went wrong!

  nuxt:generate Generate done +11ms
Done in 31.43s.

Anybody have a solution to fix this ?

jasonc08

jasonc08 posted a new question

consola • 4 months ago

Deleted

Sorry, I post the question in a wrong place. Please help me delete it.

Ca4tkin

Ca4tkin posted a new question

consola • 4 months ago

Deleted

Deleted

shx1545

shx1545 posted a new question

consola • 4 months ago

About the axios configuration plugin problem

I installed axios and configured the plugin. Why would I get an error if I didn't configure the baseURL? The page would never get in and I didn't use it to send the request.

feedgit

feedgit posted a new question

consola • 4 months ago

Use with Vuex

How can I config nuxt Localforage Module with Vuex?

Finding and no solution. Hope your helps!

sierralorenzini

sierralorenzini posted a new question

consola • 4 months ago

404 error github pages

I'm getting a 404 error on Github pages even after adding my router/base running generate/deploy and pushing to my master branch
router: {
base: '/final-project-team-32/oda-finalproject/'
},

The index.vue can be accessed here: https://duke-compsci290-spring2018.github.io/final-project-team-32/oda-finalproject/dist/

But all the links are responding with a 404 error. The links work when running dev on localhost. Any ideas?