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
The AxiosTransport of the DirectusSDK produces error: 'TypeError: axios_1.default.create is not a function' #7538
Comments
Update: The discussion related to this on the Directus Discord #SDK channel has led me to believe that the problem might be a conflict with the SDK and the Rollup bundler. One of the other members said that when they use the Vite bundler, the problem does not exist. If this issue gets fixed, it will probably help all users of the Rollup bundler to use Directus. Because I now have a workaround using Vite, there is no rush for me personally to have this fixed. However, I ask that you do consider keeping this issue open and resolving this for Rollup users at your convenience. Thanks.
|
As far as I can tell, the exports of the SDK are defined correctly: directus/packages/sdk/package.json Lines 9 to 15 in d3a8a13
(though to be honest, What was the specific rollup configuration used that failed? In the meantime, with the exports seemingly looking correct, no clear direction on what to change to make it work, and the problem only happening on a single bundler with a specific configuration, I'll have to close this as something we can't actively fix |
Preflight Checklist
Describe the Bug
I am trying to follow the instructions for installing and using the SDK as stated in the documentation. While I don't think the error is related, I should point out that I am trying to use the SDK in a SvelteJS app using the Routify router and starter template.
To Reproduce
(1) From the terminal, create a new folder to hold your app.
md testsdkwithsvelte
(2) From the terminal, navigate to your new folder.
cd testsdkwithsvelte
(3) From the terminal, install the Svelte Routify Starter Template.
npx @roxi/routify init
(4) From the terminal, install the Directus SDK.
npm install @directus/sdk
(5) Edit the main App component file (
testsdkwithsvelte\src\App.svelte
) to use the SDK.(6) From the terminal, try to run the App.
npm run dev
(7) Once the app is running, In the browser, visit
localhost:5000
. You will see error in two ways: (1) a pretty print of the error overlaying the page and (2) in the console.The console error should look something like the included image.
What version of Directus are you using?
v9.0.0-rc.90
What version of Node.js are you using?
16.3.0
What database are you using?
SQLite3 5.0.2
What browser are you using?
Chrome
What operating system are you using?
macOS
How are you deploying Directus?
running locally
The text was updated successfully, but these errors were encountered: