merhabalar ,
import Uppy from "@uppy/core";
import XHRUpload from '@uppy/xhr-upload'
import Dashboard from '@uppy/dashboard'
// And their styles (for UI plugins)
// With webpack and `style-loader`, you can import them like this:
import '@uppy/core/dist/style.css'
import '@uppy/dashboard/dist/style.css'
const uppy = new Uppy()
.use(Dashboard, {
trigger: '#select-files',
})
.use(XHRUpload, { endpoint: 'https://api2.transloadit.com' })
uppy.on('complete', (result) => {
console.log('Upload complete! We’ve uploaded these files:', result.successful)
})
yukarıda Uppy i import etmeye çalışıyorum ancak şu hatayı alıyorum :
TypeError: Failed to resolve module specifier "@uppy/core". Relative references must start with either "/", "./", or "../".
Bu hata için 5 farklı çözüm önerisinde bulunmuşlar. Bunlardan birincisi script tag ının type değerini module yapmak ve akabinde json dosyasına type='module' olarak eklemek. Ancak bu işe yaramadı. Sonrasında ise import yerine require kullanılması önerilmiş. Bunu da denedim ve işe yaramadı. Hatta require is not define hatası aldım. Bir de js uzantısında değişiklik önerilmiş. (Bu sonuncusunu denemedim. Mantıklı gelmedi bana)
Ne yaptıysam hatadan kurtulamadım.