Giter Club home page Giter Club logo

Comments (23)

hperrin avatar hperrin commented on May 26, 2024 6

@dr3adx Just so we're clear about what's going on here, I'm giving you the product of literally hundreds of hours of my labor and expertise for free, and you are complaining and cursing at me that you have to spend a few minutes figuring out what is probably either something you did wrong or the result of a change to a dependency.

from svelte-material-ui.

dr3adx avatar dr3adx commented on May 26, 2024 4

from svelte-material-ui.

dr3adx avatar dr3adx commented on May 26, 2024 2

i cant believe i have to reinstall everything now and waste my whole life fixing this shit

from svelte-material-ui.

hperrin avatar hperrin commented on May 26, 2024 2

@dr3adx https://mail.port87.com is a SvelteKit app built with the latest version of SMUI. So is https://sveltematerialui.com. I test every version with SvelteKit before I release. Also, there are thousands of users of this library, and this issue has only come up a couple times. I'm not saying that this issue isn't real or that it's definitely something you did, I'm saying the root cause is probably not something within SMUI's code base. It sounds like either a dependency issue or a build system issue. If it is and we can figure it out, I will definitely add a note in the documentation to help other users who could run into it.

It's also really unhelpful to come in here and curse at me while I'm trying to help you. It doesn't help us figure out this issue, and it will eventually get you banned.

I understand that you're frustrated and that the situation you're in sucks. I've been there myself many times. Just remember that the people on the other side of your screen are real people who don't like being treated poorly.

from svelte-material-ui.

marekdedic avatar marekdedic commented on May 26, 2024 1

@dr3adx Smui v7 is in beta, if you are on v7 and expecting perfectly stable and smooth ride without any bugs, that's your problem. On top of that, the repo is open-source, you are paying nothing for it, you are free to fork it or not use it if you don't like how it's maintained.

I'm glad @hperrin created this and maintains it (thanks!), there are some bugs (and this maybe isn't one of them but an issue on my side), you are free to report them if you find them (or not, your choice...), but don't be a dick about it.

from svelte-material-ui.

mkyral avatar mkyral commented on May 26, 2024 1

Thanks,
I can confirm that adding of this configuration line works. Maybe I should finally migrate to Vite :-D

Described in https://github.com/rollup/plugins/tree/master/packages/node-resolve/#exportconditions

from svelte-material-ui.

hperrin avatar hperrin commented on May 26, 2024 1

@marekdedic I found the equivalent for Webpack, https://webpack.js.org/configuration/resolve/#resolveconditionnames

So add this to your Webpack config:

module.exports = {
  //...
  resolve: {
    conditionNames: ['svelte', 'require', 'node'],
  },
};

from svelte-material-ui.

marekdedic avatar marekdedic commented on May 26, 2024 1

Hi,
I can confirm this works for me - thnk you very much for the help!

from svelte-material-ui.

hperrin avatar hperrin commented on May 26, 2024

I'm guessing you have different versions installed at the same time, because the ./internal path is certainly exported:

from svelte-material-ui.

hperrin avatar hperrin commented on May 26, 2024

Or maybe you need to update your version of Node/NPM/some other build tool? Maybe it's not understanding the new exports conditions. (I'm using the "svelte" export condition, as recommended by Svelte.)

from svelte-material-ui.

marekdedic avatar marekdedic commented on May 26, 2024

Hmm, it seems like I have version 7.0.0-beta.16 :/ Take a look here...

from svelte-material-ui.

hperrin avatar hperrin commented on May 26, 2024

I spotted this line:

"svelte-material-ui": "^6.2.0"

Try changing that one too.

from svelte-material-ui.

marekdedic avatar marekdedic commented on May 26, 2024

Ugh, my mistake (any thoughts about moving this package to the namespace too? Maybe something like @smui/theme?)

However, after updating that one too, I still got the error :(

skaut/shared-drive-mover#1476

from svelte-material-ui.

dr3adx avatar dr3adx commented on May 26, 2024

me too, webpack serve is FULL of same exact errors related to smui/common

from svelte-material-ui.

dr3adx avatar dr3adx commented on May 26, 2024

on a clean dir , i even removed node_modules!!

from svelte-material-ui.

mkyral avatar mkyral commented on May 26, 2024

I just got this issue in Jenkins build. It was build successfully last time (before x-mass). But something had to change between. I was not able to reproduce it locally until I fully removed node_module and package-lock.json. Then I got the same "warning".

src/main/frontend/main.ts → src/main/resources/public/build/bundle.js...

WARNING: Your @rollup/plugin-node-resolve configuration's 'exportConditions' array should include 'svelte'. See https://github.com/sveltejs/rollup-plugin-svelte#svelte-exports-condition for more information

(!) Plugin node-resolve: Could not resolve import "@smui/common/classadder" in XXX/src/node_modules/@smui/snackbar/dist/Actions.js using exports defined in XXX/src/node_modules/@smui/snackbar/node_modules/@smui/common/package.json.
(!) Plugin node-resolve: Could not resolve import "@smui/common/internal" in XXX/src/node_modules/@smui/snackbar/dist/Snackbar.svelte using exports defined in XXX/src/node_modules/@smui/snackbar/node_modules/@smui/common/package.json.
...
(!) Unresolved dependencies
https://rollupjs.org/troubleshooting/#warning-treating-module-as-external-dependency
@smui/common/internal (imported by "node_modules/@smui/snackbar/dist/Snackbar.svelte", "node_modules/@smui/banner/dist/Banner.svelte", "node_modules/@smui/textfield/dist/Textfield.svelte", "node_modules/@smui/textfield/dist/Textarea.svelte", "node_modules/@smui/textfield/dist/Input.svelte", "node_modules/@smui/banner/dist/Fixed.svelte", "node_modules/@smui/radio/dist/Radio.svelte", "node_modules/@smui/floating-label/dist/FloatingLabel.svelte", "node_modules/@smui/line-ripple/dist/LineRipple.svelte", "node_modules/@smui/notched-outline/dist/NotchedOutline.svelte", "node_modules/@smui/data-table/dist/DataTable.svelte", "node_modules/@smui/data-table/dist/Head.svelte", "node_modules/@smui/data-table/dist/Body.svelte", "node_modules/@smui/data-table/dist/Cell.svelte", "node_modules/@smui/data-table/dist/Row.svelte", "node_modules/@smui/data-table/dist/Pagination.svelte" and "node_modules/@smui-extra/badge/dist/Badge.svelte")
@smui/common/classadder (imported by "node_modules/@smui/snackbar/dist/Actions.js", "node_modules/@smui/textfield/dist/Prefix.js", "node_modules/@smui/textfield/dist/HelperLine.js" and "node_modules/@smui/textfield/dist/Suffix.js")
@smui/textfield/helper-text (imported by "src/main/frontend/components/SideBar.svelte", "src/main/frontend/components/common/SmallChangesInputField.svelte", "src/main/frontend/components/common/MarginDiffInputField.svelte", "src/main/frontend/components/job/JobWizard.svelte", "src/main/frontend/components/job/JobFiltersBar.svelte", "src/main/frontend/components/itemDetail/ItemDetailRow.svelte" and "src/main/frontend/components/itemDetail/PriceField.svelte")
(!) Circular dependencies
node_modules/@smui/snackbar/node_modules/@smui/common/dist/index.js -> node_modules/@smui/snackbar/node_modules/@smui/common/dist/CommonLabel.svelte -> node_modules/@smui/snackbar/node_modules/@smui/common/dist/index.js
node_modules/@smui/snackbar/node_modules/@smui/common/dist/index.js -> node_modules/@smui/snackbar/node_modules/@smui/common/dist/CommonIcon.svelte -> node_modules/@smui/snackbar/node_modules/@smui/common/dist/index.js
node_modules/@smui/common/dist/index.js -> node_modules/@smui/common/dist/CommonLabel.svelte -> node_modules/@smui/common/dist/index.js
...and 7 more
(!) Missing global variable names
https://rollupjs.org/configuration-options/#output-globals
Use "output.globals" to specify browser global variable names corresponding to external modules:
@smui/common/internal (guessing "internal")
@smui/common/classadder (guessing "classadder")
@smui/textfield/helper-text (guessing "HelperText$1")
created src/main/resources/public/build/bundle.js in 20s

Build finish, but app fails with:

Uncaught ReferenceError: internal is not defined
    <anonymous> main.ts:85
[main.ts:85](https://XXX/frontend/main.ts)
    <anonymous> main.ts:85

I'm still investigating what exactly changed.

I'm using svelte3, smui-v7-beta-15 and node-19.7.0

from svelte-material-ui.

hperrin avatar hperrin commented on May 26, 2024

I noticed this line:

WARNING: Your @rollup/plugin-node-resolve configuration's 'exportConditions' array should include 'svelte'.

That could be it. I don't have default exports, just "svelte" and "types", so maybe that's why it's not finding the export.

Can you try adding that export condition and see if the issue persists?

from svelte-material-ui.

hperrin avatar hperrin commented on May 26, 2024

Adopting the "svelte" export condition recently became a recommendation from the Svelte team:

https://kit.svelte.dev/docs/packaging#anatomy-of-a-package-json-exports

from svelte-material-ui.

mkyral avatar mkyral commented on May 26, 2024

I don't know exactly what I should do, but I will try.

I've tried to force beta-15, to check it out, but this does not work as npm installed some dependencies as beta-16 so I've ended up with mix of beta-15 and beta-16 packages. Unfortunately I had no more time today. I'll continue Monday.

from svelte-material-ui.

hperrin avatar hperrin commented on May 26, 2024

In your Rollup config, you should have a place where you add the @rollup/plugin-node-resolve plugin. You can add a config object to it, and put ["svelte"] into the exportConditions key.

from svelte-material-ui.

hperrin avatar hperrin commented on May 26, 2024

@marekdedic Can you try as well and let me know if that fixes the issue?

from svelte-material-ui.

marekdedic avatar marekdedic commented on May 26, 2024

Hi,
I'm sorry, but I'm confused as to what your suggestion is - my package is not a library, it's a project. It doesn't export anything and there isn't any single svelte file I could export. I'm also really confused by the svelte exports directive as a whole, so I might just be misunderstanding the whole thing.

Or are you saying I should modify the smui packages manually in my node_modules?

Additionally, I use webpack, not rollup.

from svelte-material-ui.

mkyral avatar mkyral commented on May 26, 2024

In my case it was a missing configuration for the rollup-node-resolve plugin. So you should look for something similar in webpack.

from svelte-material-ui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.