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

i use timeline for my nuxt app. but import SyntaxError, how i fix it? #94

Open
onepisYa opened this issue Apr 24, 2022 · 1 comment
Open
Labels
bug Something isn't working

Comments

@onepisYa
Copy link

Describe the bug

i use timeline for my nuxt app. but import SyntaxError, how i fix it?

To Reproduce

Expected behavior

Screenshots

Environment:

  • OS: macOS Monterey 12.3.1
  • Browser: Chrome 100.0.4896.127 (正式版本) (arm64)
  • Build environment (i.e. NodeJS): node v16.14.2 and "nuxt": "^2.15.8"

Suggestion(s) for fixing this issue

add exports fields to package.json maybe

Additional context

this is my ~/plugins/vue-horizontal-timeline.js

import Vue from "vue";
// const timeline = require("vue-horizontal-timeline"); // not work too.
// import VueHorizontalTimeline from "vue-horizontal-timeline"; // not work too.
import {VueHorizontalTimeline } from "vue-horizontal-timeline"; // Cannot use import statement outside a module

Vue.use(VueHorizontalTimeline);
// Vue.use(timeline);
@onepisYa
Copy link
Author

i add this code to my nuxt.config.js, it's work.

build: {
   transpile: ['vue-horizontal-timeline'],
 }

@guastallaigor guastallaigor added the bug Something isn't working label Apr 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants