Skip to content

Import error when using with Nuxt.js #202

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
shinriyo opened this issue Nov 21, 2018 · 3 comments
Closed

Import error when using with Nuxt.js #202

shinriyo opened this issue Nov 21, 2018 · 3 comments
Labels

Comments

@shinriyo
Copy link

i just add import InfiniteLoading from 'vue-infinite-loading'; in the .vue file

it happen

You can pass an object with default values to suppress this warning.
See https://webpack.js.org/plugins/environment-plugin for example.

  nuxt:render Rendering url / +24s
{ ReferenceError: window is not defined
    at Object.<anonymous> (/Users/shinriyo/development/soba_site/node_modules/vue-infinite-loading/dist/vue-infinite-loading.js:6:218)
    at Module._compile (module.js:649:30)
    at Object.Module._extensions..js (module.js:660:10)
    at Module.load (module.js:561:32)
    at tryModuleLoad (module.js:501:12)
    at Function.Module._load (module.js:493:3)
    at Module.require (module.js:593:17)
    at require (internal/module.js:11:18)
    at r (/Users/shinriyo/development/soba_site/node_modules/vue-server-renderer/build.js:8341:16)
    at Object.<anonymous> (server-bundle.js:3788:18)
    at __webpack_require__ (webpack:/webpack/bootstrap 737fcb4b3ce738a25c0e:25:0)
    at Object.<anonymous> (components/TheTimeLine.vue?7039:1:0)
    at __webpack_require__ (webpack:/webpack/bootstrap 737fcb4b3ce738a25c0e:25:0)
    at Object.<anonymous> (components/TheTimeLine.vue:1:0)
    at __webpack_require__ (webpack:/webpack/bootstrap 737fcb4b3ce738a25c0e:25:0)
    at Object.<anonymous> (pages/index.vue?09dc:1:0) statusCode: 500, name: 'ReferenceError' }
@shinriyo
Copy link
Author

@PeachScript
Copy link
Owner

Hi @shinriyo , thanks for your solution! But there has another point, that is the v2.3.3 can works properly just need to use the no-ssr component, it looks like relate on the vue-style-loader. I still try to find a elegant way to solve this problem, so could you wait for a while? It would be better if you can find a elegant way with me :D

@PeachScript PeachScript changed the title just import and error Import error when using with Nuxt.js Nov 23, 2018
@PeachScript
Copy link
Owner

PeachScript commented Nov 23, 2018

Hi @shinriyo , I've been released a new version v2.4.2 to fix this problem, now this plugin can works properly with Nuxt.js, just need to wrap it with no-ssr component, no need any extra configuration. Please comment here if you found any problem.

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

No branches or pull requests

2 participants