Comments (3)
@mshrtsr
Thank you for your reply.
I hope you find a good solution.
P.S.
I missed the Japanese issue.
Thank you for relating it.
from js-sdk.
Related issue: kintone/js-sdk-ja#41
from js-sdk.
@future-ota3727
Thank you for your feedback!
That is the unexpected behavior of esbuild and dual package, and we are still looking for a fundamental solution.
You can see the details of that behavior and workaround at https://zenn.dev/sosukesuzuki/articles/d8220ba2d869f0.
There are three workarounds.
- Create esbuild plugin to load rest-api-client as CJS (described in the above article)
- Bundle with another bundler, Rollup, webpack, etc.
- Use
require
.
In CJS file
Loading rest-api-client from CJS by require
const {KintoneRestAPIClient} = require("@kintone/rest-api-client")
console.info('start')
const client = new KintoneRestAPIClient({
baseUrl: 'https://hoge.hoge.hoge',
auth: { apiToken: 'hoge' },
})
console.log('end')
=> Bundled and run successfully
In ESM
Loading rest-api-client from ESM by require
import { createRequire } from "module";
const require = createRequire(import.meta.url);
const {KintoneRestAPIClient} = require("@kintone/rest-api-client")
console.info('start')
const client = new KintoneRestAPIClient({
baseUrl: 'https://hoge.hoge.hoge',
auth: { apiToken: 'hoge' },
})
console.log('end')
=> Not bundled but run successfully
(rest-api-client is loaded by require
in bundled file)
from js-sdk.
Related Issues (20)
- Support a stream on uploadFile in browsers HOT 1
- unify command-line option parser of all packages
- delete the data-loader package
- Enfoce type imports as Lint rule
- The published packages contains test codes
- Delete records command
- Support npm script to fix lint error for all packages
- The type of lookup does not exist in fieldTypes HOT 4
- Support 2FA on plugin-uploader HOT 1
- A bug report about uploadFile in kintone/rest-api-client HOT 4
- Auto-detect MIME type when using uploadFile API on browser platform
- rest-api-client with webpack outputs `Module not found: Error: Can't resolve 'path'`
- dts-gen show unclear message when specifying invalid namespace
- Drop Node.js 14.x support and add 20.x HOT 1
- [Bug] the `KintoneRestAPIClient.version` causes an Error on browser environment HOT 1
- [Bug] dts-gen causes an error if TypeScript isn't installed HOT 1
- [Feature Request] bump eslint-plugin dependency in dts-gen package HOT 4
- [Bug] Encountering TS Errors When Using @kintone/rest-api-client in Vite HOT 4
- [Action Required] Upgrade plugin-uploader by May 12, 2024
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 js-sdk.