Skip to content

Unable to use vue-carousel as a local package #302

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

Closed
rkomiyama opened this issue Oct 25, 2018 · 2 comments
Closed

Unable to use vue-carousel as a local package #302

rkomiyama opened this issue Oct 25, 2018 · 2 comments

Comments

@rkomiyama
Copy link

rkomiyama commented Oct 25, 2018

Bug Report

Current Behavior
Unable to use vue-carousel as a local package using yarn link. The following warnings are produced:

➜  ryu-carousel-cli git:(master) ✗ yarn serve
yarn run v1.10.1
$ vue-cli-service serve
 INFO  Starting development server...
 98% after emitting CopyPlugin

 WARNING  Compiled with 2 warnings                                                                                                                     12:29:37 AM

 warning  in ./src/App.vue?vue&type=script&lang=js&

"export 'Carousel' was not found in 'vue-carousel'

 warning  in ./src/App.vue?vue&type=script&lang=js&

"export 'Slide' was not found in 'vue-carousel'

Input Code and steps to reproduce
App.js

<template>
  <div id="app">
		<carousel :per-page="1" :custom-slide-width="1">
			<slide>
				Slide 1 Content
			</slide>
			<slide>
				Slide 2 Content
			</slide>
		</carousel>
	</div>
</template>

<script>
import { Carousel, Slide } from 'vue-carousel'

export default {
	name: 'App',
	components: {
		Carousel,
		Slide
	}
}
</script>

Expected behavior/code
Doing a yarn link should allow me to use vue-carousel in a local project.

Babel Configuration (.babelrc, package.json, cli command)

{
  "name": "ryu-carousel-cli",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "serve": "vue-cli-service serve",
    "build": "vue-cli-service build",
    "lint": "vue-cli-service lint"
  },
  "dependencies": {
    "vue": "^2.5.17",
    "vue-carousel": "file:../vue-carousel"
  },
  "devDependencies": {
    "@vue/cli-plugin-babel": "^3.0.5",
    "@vue/cli-plugin-eslint": "^3.0.5",
    "@vue/cli-service": "^3.0.5",
    "vue-template-compiler": "^2.5.17"
  },
  "eslintConfig": {
    "root": true,
    "env": {
      "node": true
    },
    "extends": [
      "plugin:vue/essential",
      "eslint:recommended"
    ],
    "rules": {},
    "parserOptions": {
      "parser": "babel-eslint"
    }
  },
  "postcss": {
    "plugins": {
      "autoprefixer": {}
    }
  },
  "browserslist": [
    "> 1%",
    "last 2 versions",
    "not ie <= 8"
  ]
}

Environment

  • "@vue/cli-plugin-babel": "^3.0.5"
  • Node/npm version: Node 11.0.0/npm 6.4.1
  • OS: macOS 10.12.6
@quinnlangille
Copy link
Member

quinnlangille commented Oct 25, 2018

Hey @rkomiyama, yarn has an open issue that's likely effecting this. I can recreate your issue on my local if I use yarn link, but it works fine if instead I point to my local directory with node_modules installed in my package json (i.e vue-carousel: link: ../path/to/vue-carousel)

Since it's likely that this is an issue on yarns end, I'll close this. Feel free to reopen of make a comment here if you feel otherwise! :octocat:

@rkomiyama
Copy link
Author

rkomiyama commented Oct 29, 2018

@quinnlangille I'm still getting the same warnings even with npm link. There might be an issue with vue create, but I'm not sure how relevant it is to this issue (vuejs/vue-cli#1494).

Edit: I just tried it using vue init and that seemed to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants