Skip to content
This repository was archived by the owner on Jan 18, 2022. It is now read-only.
This repository was archived by the owner on Jan 18, 2022. It is now read-only.

Version 4.1.3 cannot run #198

Closed
Closed
@easonyq

Description

@easonyq

Expected behavior

The latest version (4.1.3) can run normally

Actual behavior

There are two problems:

  1. I wrote this last Friday (version 4.1.0) and succeeded.

    const vue = require('rollup-plugin-vue')

    When I updated this morning (version 4.1.3), it threw an exception: vue is not a function

    After looking up the dist codes, I found that we should modify it to

    const vue = require('rollup-plugin-vue').default
  2. After doing above, there is still a problem remained:

    [!] (vue.delegate plugin) TypeError: Cannot read property 'stringify' of undefined
    src\page\vue-components\AppShell.vue
    TypeError: Cannot read property 'stringify' of undefined
        at Object.exports.createVuePartRequest (D:\mip-project\mip\node_modules\_rollup-plugin-vue@4.1.3
    @rollup-plugin-vue\dist\utils.js:41:72)
        at ...
    

    createVuePartRequest from dist/util.js, contains

    return `${path.basename(filename)}.${lang}?${querystring_1.default.stringify(query)}`;

    where querystring_1 equals to require('querystring').

    The key point is that querystring package uses CommonJs, not ES6 module. Below is node_modules/querystring/index.js:

    exports.decode = exports.parse = require('./decode');
    exports.encode = exports.stringify = require('./encode');

    I don't know whether this is a source code bug or a build problem.

Steps to reproduce the behavior

Just use rollup-plugin-vue with empty config.

const vue = require('rollup-plugin-vue').default;

module.exports = {
    ...
    plugins: [
        ...
        vue()
    ]
}
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions