Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rollup-plugin-vue@^4.0.1 compatibility #78

Closed
alexsasharegan opened this issue May 5, 2018 · 14 comments
Closed

rollup-plugin-vue@^4.0.1 compatibility #78

alexsasharegan opened this issue May 5, 2018 · 14 comments
Assignees
Labels
kind: bug Something isn't working properly kind: feature New feature or request scope: integration Related to an integration, not necessarily to core (but could influence core) scope: vue Related to integration with Vue (rollup-plugin-vue is long archived), not core

Comments

@alexsasharegan
Copy link

alexsasharegan commented May 5, 2018

What happens and why it is wrong

Prior to upgrading rollup-plugin-vue to v4, everything on https://github.com/alexsasharegan/vue-transmit was building okay. Upgrading to v4 generates an error in rpt2.

Terminal output
#########################################
# run the build with rollup-plugin-vue@v3
#########################################
➜  vue-transmit git:(master) ✗ npm run build

> [email protected] prebuild /Users/alex/github.com/alexsasharegan/vue-transmit
> npm run clean


> [email protected] clean /Users/alex/github.com/alexsasharegan/vue-transmit
> scripts/clean.js


> [email protected] build /Users/alex/github.com/alexsasharegan/vue-transmit
> cross-env NODE_ENV=production rollup -c ./rollup.config.js


index.umd.ts → ./dist/vue-transmit.js...
created ./dist/vue-transmit.js in 2.4s

index.umd.ts → ./dist/vue-transmit.min.js...
created ./dist/vue-transmit.min.js in 2s

/Users/alex/github.com/alexsasharegan/vue-transmit/index.ts → ./dist/vue-transmit.esm.js...
created ./dist/vue-transmit.esm.js in 1.3s

/Users/alex/github.com/alexsasharegan/vue-transmit/index.ts → ./dist/vue-transmit.esm.min.js...
created ./dist/vue-transmit.esm.min.js in 1.4s

#########################################
# update rollup-plugin-vue
#########################################
➜  vue-transmit git:(master) npm i -D rollup-plugin-vue@latest
+ [email protected]
added 3 packages from 3 contributors, removed 161 packages, updated 1 package and moved 7 packages in 11.165s

#########################################
# re-run the build
#########################################
➜  vue-transmit git:(master) ✗ npm run build

> [email protected] prebuild /Users/alex/github.com/alexsasharegan/vue-transmit
> npm run clean


> [email protected] clean /Users/alex/github.com/alexsasharegan/vue-transmit
> scripts/clean.js


> [email protected] build /Users/alex/github.com/alexsasharegan/vue-transmit
> cross-env NODE_ENV=production rollup -c ./rollup.config.js


index.umd.ts → ./dist/vue-transmit.js...
[!] (rpt2 plugin) Error: Could not find file: '/Users/alex/github.com/alexsasharegan/vue-transmit/src/components/VueTransmit.vue?{"type":"script"}#.ts'.
src/components/VueTransmit.vue?{"type":"script"}#.ts
Error: Could not find file: '/Users/alex/github.com/alexsasharegan/vue-transmit/src/components/VueTransmit.vue?{"type":"script"}#.ts'.
    at getValidSourceFile (/Users/alex/github.com/alexsasharegan/vue-transmit/node_modules/typescript/lib/typescript.js:103163:23)
    at Object.getEmitOutput (/Users/alex/github.com/alexsasharegan/vue-transmit/node_modules/typescript/lib/typescript.js:103506:30)
    at /Users/alex/github.com/alexsasharegan/vue-transmit/node_modules/rollup-plugin-typescript2/src/index.ts:192:16
    at TsCache.getCompiled (/Users/alex/github.com/alexsasharegan/vue-transmit/node_modules/rollup-plugin-typescript2/src/tscache.ts:175:24)
    at Object.transform (/Users/alex/github.com/alexsasharegan/vue-transmit/node_modules/rollup-plugin-typescript2/src/index.ts:190:20)
    at /Users/alex/github.com/alexsasharegan/vue-transmit/node_modules/rollup/dist/rollup.js:17316:48
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
    at Function.Module.runMain (module.js:695:11)
    at startup (bootstrap_node.js:188:16)
    at bootstrap_node.js:609:3

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `cross-env NODE_ENV=production rollup -c ./rollup.config.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/alex/.npm/_logs/2018-05-05T22_34_16_368Z-debug.log
➜  vue-transmit git:(master) ✗

Versions

  • typescript: 2.8.3
  • rollup: 0.58.2
  • rollup-plugin-typescript2: 0.13.0

rollup.config.js

rollup.config.js
const path = require("path");
const ts = require("rollup-plugin-typescript2");
const vue = require("rollup-plugin-vue");
const uglify = require("rollup-plugin-uglify");

const isProduction = process.env.NODE_ENV === `production`;
const kebab_name = "vue-transmit";
const pascal_name = "VueTransmit";
const tsOptions = { verbosity: 3 };
const vueOptions = { css: path.join(__dirname, `dist/${kebab_name}.css`) };

module.exports = [
	{
		input: "index.umd.ts",
		output: {
			format: "umd",
			name: pascal_name,
			file: `./dist/${kebab_name}.js`,
			sourcemap: true,
			globals: {
				vue: "Vue",
				firebase: "firebase",
			},
		},
	},
	{
		input: path.resolve(__dirname, "index.ts"),
		output: {
			format: "es",
			file: `./dist/${kebab_name}.esm.js`,
			sourcemap: true,
		},
	},
].reduce((configs, { input, output }) => {
	configs.push({
		external: ["vue", "firebase"],
		input,
		output: { ...output },
		plugins: [ts(), vue(vueOptions)],
	});

	configs.push({
		external: ["vue", "firebase"],
		input,
		output: {
			...output,
			file: replaceExtension(output.file, ".min.js"),
		},
		plugins: [ts(), vue(vueOptions), uglify()],
	});

	return configs;
}, []);

function replaceExtension(name, replacement) {
	return name.slice(0, name.lastIndexOf(".")) + replacement;
}

tsconfig.json

tsconfig.json
{
	"compileOnSave": false,
	"compilerOptions": {
		"outDir": "dist",
		"declarationDir": "dist",
		"allowSyntheticDefaultImports": true,
		"lib": ["dom", "esnext"],
		"target": "es5",
		"module": "es2015",
		"moduleResolution": "node",
		"declaration": true,
		"allowJs": false,
		"experimentalDecorators": true,
		"emitDecoratorMetadata": true,
		"noImplicitAny": true,
		"strictNullChecks": true,
		"noUnusedLocals": true,
		"noUnusedParameters": true,
		"removeComments": false,
		"preserveConstEnums": false,
		"sourceMap": true,
		"skipLibCheck": true,
		"strict": true
	},
	"include": ["src", "./index.ts", "./index.umd.ts"],
	"exclude": ["node_modules", "vendor", "dist"]
}

package.json

package.json
{
  "name": "vue-transmit",
  "version": "9.0.0-alpha.11",
  "description": "Vue.js drag & drop uploader based on Dropzone.js",
  "module": "dist/vue-transmit.esm.js",
  "main": "dist/vue-transmit.js",
  "types": "dist/index.d.ts",
  "keywords": [
    "dragndrop",
    "drag and drop",
    "file upload",
    "upload"
  ],
  "directories": {
    "test": "test"
  },
  "files": [
    "dist"
  ],
  "scripts": {
    "clean": "scripts/clean.js",
    "predev": "npm run clean",
    "dev": "cross-env NODE_ENV=development rollup -c ./rollup.config.js",
    "prebuild": "npm run clean",
    "build": "cross-env NODE_ENV=production rollup -c ./rollup.config.js",
    "prepublishOnly": "npm run build",
    "test:site": "php -S localhost:3030 -t ./test/",
    "test:jest": "jest --coverage",
    "test": "npm run test:jest",
    "precommit": "pretty-quick --staged",
    "size:min": "cat dist/vue-transmit.esm.js | wc -c",
    "size:gzip": "gzip -c dist/vue-transmit.esm.js | wc -c",
    "release:alpha": "standard-version --prerelease alpha",
    "postrelease:alpha": "git push --follow-tags origin master && npm publish --tag prerelease",
    "release:beta": "standard-version --prerelease beta",
    "postrelease:beta": "git push --follow-tags origin master && npm publish --tag prerelease",
    "release": "standard-version",
    "postrelease": "git push --follow-tags origin master && npm publish"
  },
  "jest": {
    "moduleFileExtensions": [
      "ts",
      "tsx",
      "js"
    ],
    "transform": {
      "\\.(ts|tsx)$": "<rootDir>/node_modules/ts-jest/preprocessor.js"
    },
    "testMatch": [
      "**/__tests__/*.(ts|js)",
      "**/?(*.)(spec|test).(js|ts)"
    ],
    "coverageDirectory": "coverage",
    "collectCoverage": true,
    "mapCoverage": true
  },
  "peerDependencies": {
    "vue": "^2.5.0"
  },
  "dependencies": {},
  "devDependencies": {
    "@types/jest": "^22.2.3",
    "cross-env": "^5.1.4",
    "firebase": "^4.13.1",
    "husky": "^0.14.3",
    "jest": "^22.4.3",
    "lodash": "^4.17.10",
    "postcss": "^6.0.22",
    "prettier": "^1.12.1",
    "pretty-quick": "^1.4.1",
    "rimraf": "^2.6.2",
    "rollup": "^0.58.2",
    "rollup-plugin-postcss": "^1.6.1",
    "rollup-plugin-typescript2": "^0.13.0",
    "rollup-plugin-uglify": "^3.0.0",
    "rollup-plugin-vue": "^4.0.1",
    "standard-version": "^4.3.0",
    "ts-jest": "^22.4.5",
    "typescript": "^2.8.3",
    "uglify-js": "^3.3.23",
    "vue": "^2.5.16",
    "vue-template-compiler": "^2.5.16"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/alexsasharegan/vue-transmit.git"
  },
  "author": "Alex Regan <[email protected]> (https://github.com/alexsasharegan)",
  "license": "MIT",
  "bugs": {
    "url": "https://github.com/alexsasharegan/vue-dropzone/issues"
  },
  "homepage": "https://github.com/alexsasharegan/vue-dropzone#readme"
}

plugin output with verbosity 3

Output
➜  vue-transmit git:(master) ✗ npm run build

> [email protected] prebuild /Users/alex/github.com/alexsasharegan/vue-transmit
> npm run clean


> [email protected] clean /Users/alex/github.com/alexsasharegan/vue-transmit
> scripts/clean.js


> [email protected] build /Users/alex/github.com/alexsasharegan/vue-transmit
> cross-env NODE_ENV=production rollup -c ./rollup.config.js


index.umd.ts → ./dist/vue-transmit.js...
rpt2: typescript version: 2.8.3
rpt2: rollup-plugin-typescript2 version: 0.13.0
rpt2: plugin options:
{
    "verbosity": 3,
    "clean": true,
    "check": true,
    "cacheRoot": "/Users/alex/github.com/alexsasharegan/vue-transmit/.rpt2_cache",
    "include": [
        "*.ts+(|x)",
        "**/*.ts+(|x)"
    ],
    "exclude": [
        "*.d.ts",
        "**/*.d.ts"
    ],
    "abortOnError": true,
    "rollupCommonJSResolveHack": false,
    "typescript": "version 2.8.3",
    "useTsconfigDeclarationDir": false,
    "tsconfigOverride": {},
    "tsconfigDefaults": {}
}
rpt2: rollup config:
{
    "external": [
        "vue",
        "firebase",
        "",
        ""
    ],
    "input": "index.umd.ts",
    "chunkGroupingSize": 5000,
    "perf": false,
    "plugins": [
        {
            "name": "rpt2"
        },
        {
            "name": "vue.delegate"
        }
    ],
    "entry": "index.umd.ts"
}
rpt2: built-in options overrides: {
    "noEmitHelpers": false,
    "importHelpers": true,
    "noResolve": false,
    "noEmit": false,
    "outDir": "/Users/alex/github.com/alexsasharegan/vue-transmit",
    "moduleResolution": 2,
    "declarationDir": "/Users/alex/github.com/alexsasharegan/vue-transmit"
}
rpt2: parsed tsconfig: {
    "options": {
        "module": 5,
        "outDir": "/Users/alex/github.com/alexsasharegan/vue-transmit",
        "declarationDir": "/Users/alex/github.com/alexsasharegan/vue-transmit",
        "allowSyntheticDefaultImports": true,
        "lib": [
            "lib.dom.d.ts",
            "lib.esnext.d.ts"
        ],
        "target": 1,
        "moduleResolution": 2,
        "declaration": true,
        "allowJs": false,
        "experimentalDecorators": true,
        "emitDecoratorMetadata": true,
        "noImplicitAny": true,
        "strictNullChecks": true,
        "noUnusedLocals": true,
        "noUnusedParameters": true,
        "removeComments": false,
        "preserveConstEnums": false,
        "sourceMap": true,
        "skipLibCheck": true,
        "strict": true,
        "noEmitHelpers": false,
        "importHelpers": true,
        "noResolve": false,
        "noEmit": false,
        "configFilePath": "/Users/alex/github.com/alexsasharegan/vue-transmit/tsconfig.json"
    },
    "fileNames": [
        "/Users/alex/github.com/alexsasharegan/vue-transmit/src/global.d.ts",
        "/Users/alex/github.com/alexsasharegan/vue-transmit/src/index.ts",
        "/Users/alex/github.com/alexsasharegan/vue-transmit/src/classes/VTransmitFile.ts",
        "/Users/alex/github.com/alexsasharegan/vue-transmit/src/classes/VTransmitUploadContext.ts",
        "/Users/alex/github.com/alexsasharegan/vue-transmit/src/core/interfaces.ts",
        "/Users/alex/github.com/alexsasharegan/vue-transmit/src/core/utils.ts",
        "/Users/alex/github.com/alexsasharegan/vue-transmit/src/upload-adapters/firebase.ts",
        "/Users/alex/github.com/alexsasharegan/vue-transmit/src/upload-adapters/xhr.ts",
        "/Users/alex/github.com/alexsasharegan/vue-transmit/index.ts",
        "/Users/alex/github.com/alexsasharegan/vue-transmit/index.umd.ts"
    ],
    "typeAcquisition": {
        "enable": false,
        "include": [],
        "exclude": []
    },
    "raw": {
        "compilerOptions": {
            "module": "es2015",
            "outDir": "dist",
            "declarationDir": "dist",
            "allowSyntheticDefaultImports": true,
            "lib": [
                "dom",
                "esnext"
            ],
            "target": "es5",
            "moduleResolution": "node",
            "declaration": true,
            "allowJs": false,
            "experimentalDecorators": true,
            "emitDecoratorMetadata": true,
            "noImplicitAny": true,
            "strictNullChecks": true,
            "noUnusedLocals": true,
            "noUnusedParameters": true,
            "removeComments": false,
            "preserveConstEnums": false,
            "sourceMap": true,
            "skipLibCheck": true,
            "strict": true
        },
        "compileOnSave": false,
        "include": [
            "src",
            "./index.ts",
            "./index.umd.ts"
        ],
        "exclude": [
            "node_modules",
            "vendor",
            "dist"
        ]
    },
    "errors": [],
    "wildcardDirectories": {},
    "compileOnSave": false,
    "configFileSpecs": {
        "includeSpecs": [
            "src",
            "./index.ts",
            "./index.umd.ts"
        ],
        "excludeSpecs": [
            "node_modules",
            "vendor",
            "dist"
        ],
        "validatedIncludeSpecs": [
            "src",
            "./index.ts",
            "./index.umd.ts"
        ],
        "validatedExcludeSpecs": [
            "node_modules",
            "vendor",
            "dist"
        ],
        "wildcardDirectories": {}
    }
}
rpt2: included:
'[
    "*.ts+(|x)",
    "**/*.ts+(|x)"
]'
rpt2: excluded:
'[
    "*.d.ts",
    "**/*.d.ts"
]'
rpt2: Ambient types:
rpt2:     /Users/alex/github.com/alexsasharegan/vue-transmit/src/global.d.ts
rpt2:     /Users/alex/github.com/alexsasharegan/vue-transmit/node_modules/@types/estree/index.d.ts
rpt2:     /Users/alex/github.com/alexsasharegan/vue-transmit/node_modules/@types/jest/index.d.ts
rpt2:     /Users/alex/github.com/alexsasharegan/vue-transmit/node_modules/@types/node/index.d.ts
rpt2: ambient types changed, redoing all semantic diagnostics
rpt2: cleaning cache: /Users/alex/github.com/alexsasharegan/vue-transmit/.rpt2_cache/2e114634f27dc3edb218e480a57846efae52f054
rpt2: transpiling '/Users/alex/github.com/alexsasharegan/vue-transmit/index.umd.ts'
rpt2:     cache: '49761a9d3cb78f1200fa5ea2cf4554c239130b2b'
rpt2:     cache miss
rpt2:     cache: '49761a9d3cb78f1200fa5ea2cf4554c239130b2b'
rpt2:     cache miss
rpt2:     cache: '49761a9d3cb78f1200fa5ea2cf4554c239130b2b'
rpt2:     cache miss
rpt2: generated declarations for '/Users/alex/github.com/alexsasharegan/vue-transmit/index.umd.ts'
rpt2: dependency '/Users/alex/github.com/alexsasharegan/vue-transmit/index.ts'
rpt2:     imported by '/Users/alex/github.com/alexsasharegan/vue-transmit/index.umd.ts'
rpt2: resolving './index'
rpt2:     to '/Users/alex/github.com/alexsasharegan/vue-transmit/index.ts'
rpt2: transpiling '/Users/alex/github.com/alexsasharegan/vue-transmit/index.ts'
rpt2:     cache: 'cfdd26383d14689fe5e8078105fc3da90ae47d57'
rpt2:     cache miss
rpt2:     cache: 'cfdd26383d14689fe5e8078105fc3da90ae47d57'
rpt2:     cache miss
rpt2:     cache: 'cfdd26383d14689fe5e8078105fc3da90ae47d57'
rpt2:     cache miss
rpt2: generated declarations for '/Users/alex/github.com/alexsasharegan/vue-transmit/index.ts'
rpt2: dependency '/Users/alex/github.com/alexsasharegan/vue-transmit/src/index.ts'
rpt2:     imported by '/Users/alex/github.com/alexsasharegan/vue-transmit/index.ts'
rpt2: resolving './src/index'
rpt2:     to '/Users/alex/github.com/alexsasharegan/vue-transmit/src/index.ts'
rpt2: dependency '/Users/alex/github.com/alexsasharegan/vue-transmit/src/upload-adapters/xhr.ts'
rpt2:     imported by '/Users/alex/github.com/alexsasharegan/vue-transmit/index.ts'
rpt2: resolving './src/upload-adapters/xhr'
rpt2:     to '/Users/alex/github.com/alexsasharegan/vue-transmit/src/upload-adapters/xhr.ts'
rpt2: dependency '/Users/alex/github.com/alexsasharegan/vue-transmit/src/upload-adapters/firebase.ts'
rpt2:     imported by '/Users/alex/github.com/alexsasharegan/vue-transmit/index.ts'
rpt2: resolving './src/upload-adapters/firebase'
rpt2:     to '/Users/alex/github.com/alexsasharegan/vue-transmit/src/upload-adapters/firebase.ts'
rpt2: dependency '/Users/alex/github.com/alexsasharegan/vue-transmit/src/core/utils.ts'
rpt2:     imported by '/Users/alex/github.com/alexsasharegan/vue-transmit/index.ts'
rpt2: resolving './src/core/utils'
rpt2:     to '/Users/alex/github.com/alexsasharegan/vue-transmit/src/core/utils.ts'
rpt2: transpiling '/Users/alex/github.com/alexsasharegan/vue-transmit/src/index.ts'
rpt2:     cache: '07a85db626deafe67a055f45cf879446275068d6'
rpt2:     cache miss
rpt2:     cache: '07a85db626deafe67a055f45cf879446275068d6'
rpt2:     cache miss
rpt2:     cache: '07a85db626deafe67a055f45cf879446275068d6'
rpt2:     cache miss
rpt2: generated declarations for '/Users/alex/github.com/alexsasharegan/vue-transmit/src/index.ts'
rpt2: transpiling '/Users/alex/github.com/alexsasharegan/vue-transmit/src/upload-adapters/xhr.ts'
rpt2:     cache: '069a4a7a8969f2603cf55cc36d41ce843fdd5290'
rpt2:     cache miss
rpt2:     cache: '069a4a7a8969f2603cf55cc36d41ce843fdd5290'
rpt2:     cache miss
rpt2:     cache: '069a4a7a8969f2603cf55cc36d41ce843fdd5290'
rpt2:     cache miss
rpt2: generated declarations for '/Users/alex/github.com/alexsasharegan/vue-transmit/src/upload-adapters/xhr.ts'
rpt2: transpiling '/Users/alex/github.com/alexsasharegan/vue-transmit/src/upload-adapters/firebase.ts'
rpt2:     cache: '46456584c1a94aea483510cb2cd922dc05102338'
rpt2:     cache miss
rpt2:     cache: '46456584c1a94aea483510cb2cd922dc05102338'
rpt2:     cache miss
rpt2:     cache: '46456584c1a94aea483510cb2cd922dc05102338'
rpt2:     cache miss
rpt2: generated declarations for '/Users/alex/github.com/alexsasharegan/vue-transmit/src/upload-adapters/firebase.ts'
rpt2: transpiling '/Users/alex/github.com/alexsasharegan/vue-transmit/src/core/utils.ts'
rpt2:     cache: '35939121a8c0293ccd932395131ec5df0105f22c'
rpt2:     cache miss
rpt2:     cache: '35939121a8c0293ccd932395131ec5df0105f22c'
rpt2:     cache miss
rpt2:     cache: '35939121a8c0293ccd932395131ec5df0105f22c'
rpt2:     cache miss
rpt2: generated declarations for '/Users/alex/github.com/alexsasharegan/vue-transmit/src/core/utils.ts'
rpt2: dependency '/Users/alex/github.com/alexsasharegan/vue-transmit/src/core/utils.ts'
rpt2:     imported by '/Users/alex/github.com/alexsasharegan/vue-transmit/src/upload-adapters/xhr.ts'
rpt2: resolving '../core/utils'
rpt2:     to '/Users/alex/github.com/alexsasharegan/vue-transmit/src/core/utils.ts'
rpt2: dependency '/Users/alex/github.com/alexsasharegan/vue-transmit/src/core/utils.ts'
rpt2:     imported by '/Users/alex/github.com/alexsasharegan/vue-transmit/src/upload-adapters/firebase.ts'
rpt2: resolving '../core/utils'
rpt2:     to '/Users/alex/github.com/alexsasharegan/vue-transmit/src/core/utils.ts'
rpt2: transpiling '/Users/alex/github.com/alexsasharegan/vue-transmit/src/components/VueTransmit.vue?{"type":"script"}#.ts'
rpt2:     cache: 'c3af5fe8e2fa9475cb81f40c13777e7d9cd67017'
rpt2:     cache miss
[!] (rpt2 plugin) Error: Could not find file: '/Users/alex/github.com/alexsasharegan/vue-transmit/src/components/VueTransmit.vue?{"type":"script"}#.ts'.
src/components/VueTransmit.vue?{"type":"script"}#.ts
Error: Could not find file: '/Users/alex/github.com/alexsasharegan/vue-transmit/src/components/VueTransmit.vue?{"type":"script"}#.ts'.
    at getValidSourceFile (/Users/alex/github.com/alexsasharegan/vue-transmit/node_modules/typescript/lib/typescript.js:103163:23)
    at Object.getEmitOutput (/Users/alex/github.com/alexsasharegan/vue-transmit/node_modules/typescript/lib/typescript.js:103506:30)
    at /Users/alex/github.com/alexsasharegan/vue-transmit/node_modules/rollup-plugin-typescript2/src/index.ts:192:16
    at TsCache.getCompiled (/Users/alex/github.com/alexsasharegan/vue-transmit/node_modules/rollup-plugin-typescript2/src/tscache.ts:175:24)
    at Object.transform (/Users/alex/github.com/alexsasharegan/vue-transmit/node_modules/rollup-plugin-typescript2/src/index.ts:190:20)
    at /Users/alex/github.com/alexsasharegan/vue-transmit/node_modules/rollup/dist/rollup.js:17316:48
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
    at Function.Module.runMain (module.js:695:11)
    at startup (bootstrap_node.js:188:16)
    at bootstrap_node.js:609:3

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `cross-env NODE_ENV=production rollup -c ./rollup.config.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/alex/.npm/_logs/2018-05-05T22_55_28_977Z-debug.log
@alexsasharegan
Copy link
Author

If you want to work any debugging magic, you can clone the repo and install the latest rollup-plugin-vue.

git clone [email protected]:alexsasharegan/vue-transmit.git
cd vue-transmit
npm i
npm i -D rollup-plugin-vue@^4.0.1
npm run build

@ezolenko ezolenko self-assigned this May 7, 2018
@ezolenko
Copy link
Owner

ezolenko commented May 7, 2018

@alexsasharegan looks like vue plugin is supposed to generate a ts file, right? Could you try placing vue(vueOptions) before ts() in your config?

@alexsasharegan
Copy link
Author

Tried that just now with [email protected], and received an error. I believe the TS syntax is choking the other plugins. Have a look at the output:

➜  vue-transmit git:(master) ✗ npm run build

> [email protected] prebuild /Users/alex/github.com/alexsasharegan/vue-transmit
> npm run clean


> [email protected] clean /Users/alex/github.com/alexsasharegan/vue-transmit
> scripts/clean.js


> [email protected] build /Users/alex/github.com/alexsasharegan/vue-transmit
> cross-env NODE_ENV=production rollup -c ./rollup.config.js


src/index.umd.ts → ./dist/vue-transmit.js...
[!] Error: Unexpected token
src/components/VueTransmit.vue.ts?rollup_plugin_vue=%7B%22type%22%3A%22script%22%2C%22lang%22%3A%22ts%22%7D (86:5)
84: import { DriverInterface, DriverConstructor } from "../core/interfaces";
85:
86: type FileSystemEntry = WebKitFileEntry | WebKitDirectoryEntry;
         ^
87:
88: export default Vue.extend({

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `cross-env NODE_ENV=production rollup -c ./rollup.config.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/alex/.npm/_logs/2018-05-07T16_54_41_779Z-debug.log

@ezolenko
Copy link
Owner

ezolenko commented May 7, 2018

Try modifying include filter for rpt2 to something like that: include: ["*.ts+(|x)", "**/*.ts+(|x)", RegExp(".*\.ts\?.*")],

(["*.ts+(|x)", "**/*.ts+(|x)"] is the default)

@alexsasharegan
Copy link
Author

alexsasharegan commented May 7, 2018

Now it cannot find the file:

➜  vue-transmit git:(master) ✗ npm run build

> [email protected] prebuild /Users/alex/github.com/alexsasharegan/vue-transmit
> npm run clean


> [email protected] clean /Users/alex/github.com/alexsasharegan/vue-transmit
> scripts/clean.js


> [email protected] build /Users/alex/github.com/alexsasharegan/vue-transmit
> cross-env NODE_ENV=production rollup -c ./rollup.config.js


src/index.umd.ts → ./dist/vue-transmit.js...
[!] (rpt2 plugin) Error: Could not find file: '/Users/alex/github.com/alexsasharegan/vue-transmit/src/components/VueTransmit.vue'.
src/components/VueTransmit.vue
Error: Could not find file: '/Users/alex/github.com/alexsasharegan/vue-transmit/src/components/VueTransmit.vue'.
    at getValidSourceFile (/Users/alex/github.com/alexsasharegan/vue-transmit/node_modules/typescript/lib/typescript.js:103163:23)
    at Object.getEmitOutput (/Users/alex/github.com/alexsasharegan/vue-transmit/node_modules/typescript/lib/typescript.js:103506:30)
    at /Users/alex/github.com/alexsasharegan/vue-transmit/node_modules/rollup-plugin-typescript2/src/index.ts:192:16
    at TsCache.getCompiled (/Users/alex/github.com/alexsasharegan/vue-transmit/node_modules/rollup-plugin-typescript2/src/tscache.ts:175:24)
    at Object.transform (/Users/alex/github.com/alexsasharegan/vue-transmit/node_modules/rollup-plugin-typescript2/src/index.ts:190:20)
    at /Users/alex/github.com/alexsasharegan/vue-transmit/node_modules/rollup/dist/rollup.js:17316:48
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
    at Function.Module.runMain (module.js:695:11)
    at startup (bootstrap_node.js:188:16)
    at bootstrap_node.js:609:3

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `cross-env NODE_ENV=production rollup -c ./rollup.config.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/alex/.npm/_logs/2018-05-07T18_28_09_072Z-debug.log

For reference, here are the files:

src
├── classes
│   ├── VTransmitFile.ts
│   └── VTransmitUploadContext.ts
├── components
│   └── VueTransmit.vue
├── core
│   ├── interfaces.ts
│   └── utils.ts
├── global.d.ts
├── index.ts
├── index.umd.ts
└── upload-adapters
    ├── firebase.ts
    ├── index.ts
    └── xhr.ts

@ezolenko
Copy link
Owner

ezolenko commented May 8, 2018

I can't make your project build in my environment (win10, terminal or git bash).

$ NODE_ENV=production ./node_modules/.bin/rollup -c ./rollup.config.js

src/index.umd.ts → ./dist/vue-transmit.js...
[!] TypeError: Cannot read property 'script' of undefined
TypeError: Cannot read property 'script' of undefined
    at resolveVuePart (E:\source\scr\vue-transmit\node_modules\rollup-plugin-vue\src\utils.js:68:16)
    at resolveId (E:\source\scr\vue-transmit\node_modules\rollup-plugin-vue\src\index.js:45:25)
    at E:\source\scr\vue-transmit\node_modules\rollup\dist\rollup.js:5977:113
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
    at Function.Module.runMain (module.js:695:11)
    at startup (bootstrap_node.js:188:16)
    at bootstrap_node.js:609:3

And yeah, it works if I switch back to "rollup-plugin-vue": "^3.0.0".

Maybe open a bug with rollup-plugin-vue as well? Whatever they changed in v4 breaks things.

@alexsasharegan
Copy link
Author

I'll try and link this issue over there today or tomorrow.

@alexsasharegan
Copy link
Author

A little late, but I linked the issue at rollup-plugin-vue.

@znck
Copy link

znck commented May 25, 2018

.vue file can have a <script lang="ts">...</script> block.

Such blocks are converted to virtual modules. For example: Typescript block in ./foo/bar.vue would be represented by ./foo/bar.vue?rollup-plugin-vue=script.ts.

Test cases on fixture (https://github.com/vuejs/rollup-plugin-vue/blob/master/test/fixtures/with-script-typescript.vue) works fine with https://github.com/rollup/rollup-plugin-typescript.

@ezolenko
Copy link
Owner

ezolenko commented Jun 5, 2018

Hm, yes, looks like typescript is trying to load that file directly instead of requesting a snapshot from me for some reason.

@alexsasharegan
Copy link
Author

Any progress on this? The folks over on vuejs/rollup-plugin-vue#204 are curious if it's resolved. Is this an issue on their end, or here with the TS plugin?

@ezolenko
Copy link
Owner

Sorry haven't looked at it in a while, I'll check again soon.

@ezolenko
Copy link
Owner

@alexsasharegan ok, was much simpler than I thought, I was not returning updated list of cached modules to typescript, so it tried to find the module on its own. Should be fixed now, I'll make a release a bit later.

@hiendv
Copy link

hiendv commented Sep 4, 2018

I'm experiencing this in watch mode, but it happens randomly

@agilgur5 agilgur5 changed the title rollup-plugin-vue@^4.0.1 compatibility rollup-plugin-vue@^4.0.1 compatibility May 22, 2022
@agilgur5 agilgur5 added scope: integration Related to an integration, not necessarily to core (but could influence core) kind: bug Something isn't working properly kind: feature New feature or request labels May 22, 2022
Repository owner locked as resolved and limited conversation to collaborators May 22, 2022
@agilgur5 agilgur5 added the scope: vue Related to integration with Vue (rollup-plugin-vue is long archived), not core label Mar 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind: bug Something isn't working properly kind: feature New feature or request scope: integration Related to an integration, not necessarily to core (but could influence core) scope: vue Related to integration with Vue (rollup-plugin-vue is long archived), not core
Projects
None yet
Development

No branches or pull requests

5 participants