Comments (13)
I forked that official Vue demo app,
vue-hackernews-2.0, created a branch called vue-cropperjs-issue-39
, and made one commit.
Here are the steps you can go through to reproduce the problem on your own computer:
-
Clone
https://github.com/ataylor32/vue-hackernews-2.0.git
-
Check out the
vue-cropperjs-issue-39
branch -
Run
npm ci
-
Start the site in development mode by running
npm run dev
-
Go to http://localhost:8080/top in your browser and click on one of the comments links. You will be navigated to a comments page and if you look below the header, you'll see a file input. Browse for a GIF, JPG, or PNG and you'll see that vue-cropperjs is working fine. Now refresh the page (i.e. try to get server-side rendering to render the page) and it will break. Stop the site with Ctrl+C.
-
Start the site in production mode by running
npm run build && npm start
and then repeat the previous step and you'll see that it behaves the same in production mode
Thank you!
from vue-cropperjs.
I'm running into this too. @Agontuk Would you be willing to reopen this issue? I would really like to get this working. This is what I'm getting:
/var/www/example.com/node_modules/cropperjs/dist/cropper.css:11
.cropper-container {
^
SyntaxError: Unexpected token .
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:616:28)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/var/www/example.com/node_modules/vue-cropperjs/dist/VueCropper.js:15:1)
error during render : /profile/
/var/www/example.com/node_modules/cropperjs/dist/cropper.css:11
.cropper-container {
^
SyntaxError: Unexpected token .
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:616:28)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/var/www/example.com/node_modules/vue-cropperjs/dist/VueCropper.js:15:1)
from vue-cropperjs.
@ataylor32 , sorry for the late response. New version 4.0.0 is published and should work on SSR now. Note that default css import is removed now so you have to import it in your file where you're using it. Readme has been updated.
from vue-cropperjs.
I end up using another library.
from vue-cropperjs.
I end up using another library.
Have same issue, what library you use now?
from vue-cropperjs.
I end up using another library.
Have same issue, what library you use now?
I use https://github.com/zhanziyang/vue-croppa, it's fairly easy to configure. Check it out.
from vue-cropperjs.
I end up using another library.
Have same issue, what library you use now?
I use https://github.com/zhanziyang/vue-croppa, it's fairly easy to configure. Check it out.
Thanks
from vue-cropperjs.
我刚刚解决了!(环境是: electron-vue。)
在 node_modules/vue-cropperjs/dist/VueCropper.js
注释这一行:
然后在 VUE 页面的 style 引入即可。
<style lang="scss">
@import "cropper.css";
p.s:估计这是JS引用CSS报错导致的。肯定有更好的解决方法,如webpack配置。
有好的方法。欢迎下面留言。
from vue-cropperjs.
@ataylor32 , seems like your setup is not recognizing the css syntax. Can you check if you can enable css loader so that it can parse css ?
from vue-cropperjs.
@Agontuk I'm using this:
{
test: /\.css$/,
loader: ['vue-style-loader', 'css-loader'],
},
This is only an issue with server-side rendering. My project is based on an official Vue demo app,
vue-hackernews-2.0.
from vue-cropperjs.
Can you give me a example repo so that I can reproduce the issue on my end ? I have yet to try out the server side rendering in vue so don't know the exact issue.
from vue-cropperjs.
Thanks for the detailed steps, I'm checking out the vue ssr guide to get familiar with it. Then I'll check on the issue.
from vue-cropperjs.
No problem. Thanks for fixing it! It works for me now.
from vue-cropperjs.
Related Issues (20)
- Crop drag and resize not smooth HOT 3
- _cropperjs2.default is not a constructor HOT 2
- How work with base64 returns url? HOT 2
- Using replace() returns [Obj Obj] HOT 1
- Different cropped image result on different OS/screens (blurry images) HOT 1
- When we resize cropper and move cropper browser is crashed or sometimes its hangs too much HOT 1
- When we resize cropper and move cropper browser is crashed or sometimes its hangs too much. Cropper is not working smoothly at all HOT 2
- Vue-Cropperjs issue with 5.0.0 version HOT 2
- Can't see autoCrop Layout on image HOT 2
- replace() function doesn't work with the last version of Cropper JS HOT 1
- Maximum Call Stack exceed on cropping image HOT 2
- Can't Re-initialize the cropper
- Base64 as source
- Property does not exist on Type (Vue 3 + setup syntax + TS)
- Updating to vue 3.4.7 from 3.4.8 breaks things.
- How can I set an Options for minimum crop width and height ?
- The first argument is required and must be an <img> or <canvas> element. HOT 7
- vite build error : 'default' is not exported by node_modules/vue/dist/vue.runtime.esm-bundler.js, imported by node_modules HOT 2
- Error in render: "TypeError: (0 , _vue.h) is not a function" HOT 2
- Transparent background will become black background HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vue-cropperjs.