PDF import NextJS - pdf

I want to import a pdf file and edit it and export it. But if I do import file from '../public/pdf/front.pdf'; I am getting "Module parse failed: Unexpected token (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
(Source code omitted for this binary file)" Please help.

Related

Neo4j Desktop | Neo.ClientError.Statement.ExternalResourceFailed

Here, I simply introduce my situation about configuration:
System: Windows 11
Neo4j Desktop Version: 1.4.15
when I had finished that imports csv file to the C:\Users\ouyangkang\.Neo4jDesktop\relate-data\dbmss\dbms-00982ce7-0cb6-4ee7-b15a-1bc12ac5890e\import direcotry. I clicked open button and run following command:
LOAD CSV WITH HEADERS FROM 'file:///film_name.csv' AS row MERGE (n:name {name: row.name, encoding: row.encoding});
I got a error:
Couldn't load the external resource at: file:/C:/Users/ouyangkang/.Neo4jDesktop/relate-data/dbmss/dbms-00982ce7-0cb6-4ee7-b15a-1bc12ac5890e/import/film_name.csv
And I saw a similar error solution in Neo.ClientError.Statement.ExternalResourceFailed. I got a new error when configuration the neo4j.conf file
Couldn't load the external resource at: file:/film_name.csv
What's worse, I can't use the import function, it reminded that Trying to open undefined directory.
Please help me, thanks
I finially found the error that it is the file format question. The Neo4j not can use all csv file. You need to convert the file to guaratee the file format is standardized csv file with seperating by ','

How to import localforage to service worker using importScripts?

I'm trying to import localforage to my service-worker.js file. I've read, you have to use
importScripts() to do so. Thing is I installed localforage in my Vue project using yarn and now i'm not sure where to access the localforage file.
I tried:
importScripts('localforage.js')
importScripts('localforage')
importScripts('localforage.min.js')
resulting in: service-worker.js:6 Uncaught DOMException: Failed to execute 'importScripts' on 'WorkerGlobalScope': The script at 'https://webprojectname/localforage.min.js' failed to load.
at https://webprojectname/service-worker.js:6:1
and: The script has an unsupported MIME type ('text/html').
I searched a lot googling but didn't find a solution.
Every help is appreciated.
It seems that you file is served with the wrong MIME type. Check your server config.

Module parse failed: Unexpected character '' (1:2) You may need an appropriate loader to handle this file type

I tried to paste .xlsx file to assets/files/ in vue, then I got this error
warning in ./src/assets/files/example-format.xlsx
Module parse failed: Unexpected character '' (1:2)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
(Source code omitted for this binary file)
# ./src/assets sync ^\.\/.*$
# ./src/main.js
# multi (webpack)-dev-server/client?http://192.168.1.131:8080/sockjs-node (webpack)/hot/dev-server.js ./src/main.js
how I can solve it? thank you so much
Put .xlsx file into public directory, and then Download, if you just want to the other people download it

Read yaml file with vue.js from disk (not URL)

In Vue.js I would like to read a YAML file from my filesystem (this file is not available online so can not be requested via URL), convert it to JSON and somehow expose it in a way that all components can access it. How can I do it?
I should probably use js-yaml but I can't find a way for it to work in Vue.js.
I may be missing the problem, but
npm install yaml-js --save
then import into component and use
<script>
import { yaml } from 'yaml-js'
// or maybe the following, try both
import yaml from 'yaml-js'
Your biggest problem would be the location of the Yaml file to be read in. I'm reading files from the static folder, so if you can locate it there you should be able to read it with
return Vue.http.get('Yaml.whatever')
.then(response => {
// process response.body
In main.js set up the root path (must be within your web site)
import VueResource from 'vue-resource'
Vue.use(VueResource)
Vue.http.options.root = './static/'

Google app engine: parse a sql database

I have a MyFile entity with sql db file:
class MyFile(ndb.Model):
data = ndb.BlobProperty()
data property store sql db file. So in requestHandler I need to parse this file.
I am trying to using standard sqlite3 library, but getting error on gae side:
ImportError: No module named _sqlite3
With PyDbLite library I am getting error too:
from PyDbLite.SQLite import Database, Table
File "libs/PyDbLite/SQLite.py", line 81, in <module>
from pysqlite2 import dbapi2 as sqlite
Is there any way to parse sql database in goggle app engine?
I know that gae uses NoSQL datastore, I just need to handle sql db file.
The module _sqlite3 may be in your python path locally, but when deployed, the module cannot be found. You can debug your python path by printing it when in production and making sure the module is visible on that path (keep in mind that any old file or folder isn't considered a module ready for import by python, it needs to have __init__.py).
The only reason you would receive that error is if you either
A) failed to upload the module you're using as part of your project, mistakenly believing that since it was visible to your local python code it should be visible when deployed
or
B) failed to reference the uploaded module correctly. My comments in the first paragraph should help you debug this case.