commercetools / sunrise-spa

SUNRISE shop template as a single-page application
https://sunrise-spa.now.sh
Apache License 2.0
51 stars 77 forks source link

You may need an additional loader to handle the result of these loaders #293

Closed Divya-Gunaseelan closed 2 years ago

Divya-Gunaseelan commented 2 years ago

Hi, I get the below error while trying to setup sunrise spa with my existing merchant center project (sunrise data).

Module parse failed: Unexpected token (114:24) File was processed with these loaders:

Could some one please help me in sorting out this? I have also attached the list of errors and supporting configuration files for reference. And, I use "yarn start" to run my project.

harm-meijer commented 2 years ago

@Divya-Gunaseelan Can you try installing the dependencies with yarn install --frozen-lockfile? With VUE minor updates can break the build, this should not be the case according to npm specs but it still does.

You should also make sure that unchanged code works. If you really get stuck you can send me a link to the forked repo and I'll have a look.

Divya-Gunaseelan commented 2 years ago

@harm-meijer Thank you. It worked and the sunrise spa site is now hosted on my localhost. I am trying to set up sunrise spa with sunrise data. Below are the steps that I've followed and could not see any sync between sunrise spa and sunrise data.

  1. Created new project in MC (with project key div-sunrise-spa)
  2. Downloaded sunrise data zip file from https://github.com/commercetools/commercetools-sunrise-data
  3. Unzipped the sunrise data folder and opened it in Visual Studio Code
  4. npm install
  5. Created new API client (admin client) in MC and downloaded client credentials in .env format
  6. copied .env file to the root folder
  7. npm run start

Sunrise Data is now available in the MC without any issues.

Now with sunrise spa:

  1. Downloaded sunrise spa zip file from https://github.com/commercetools/sunrise-spa/tree/development
  2. Unzipped the file and opened it in visual studio code
  3. yarn install --frozen-lockfile
  4. Created new API client (SPA client) in MC and downloaded client credentials in Sunrise Spa format
  5. Copied the client credentials to the root folder and renamed the file to .env.local
  6. yarn start Sunrise Spa page opens successfully on my localhost. But, the sunrise data is not populated in the sunrise spa website.

I am missing something here. But not sure what it is! Could you please help me out with this?

Many thanks in advance.

harm-meijer commented 2 years ago

@Divya-Gunaseelan Since you use sunrise-data the locales and locations should be set up correctly so nothing needs to be done there. If you open the devtools in the browser can you run the following command in the console: localStorage.clear() when you refresh the page it should get a new token connecting to your merchant center project (see in the console what config is uses).

Are there any errors in the console?

Divya-Gunaseelan commented 2 years ago

@harm-meijer thanks a lot for helping me in setting this up! Sunrise Spa is now working fine (I can see my MC project in the config). I tried to create a test product in MC but could not see the product in the spa (frontend). Hope this takes some time to be visible at the frontend.

Thanks again for the timely help! 🙂

harm-meijer commented 2 years ago

@Divya-Gunaseelan make sure the product is available in all prices. Spa uses price selection and if a price is not available for a country/currency (and optional customer group and channel) then the product will not show in product lists. In the merchant center under product detail click on the variant to get variant detail and then prices, make sure a price is provided for the country and currency you are using in the url (for example DE is Germany and Euro and US is United States and US dollar).

Divya-Gunaseelan commented 2 years ago

@harm-meijer This is noted. Will check on this. Thank you!

amolbotre769 commented 2 years ago

@Divya-Gunaseelan and @harm-meijer I try all the steps as you explain in comment but is still showing the same error.

error in ./src/presentation/fashion/CartDetail/CartLikeContentDetail/LineItemInfo/LineItemInfo.vue?vue&type=template&id=a0f2a550

Module parse failed: Unexpected token (114:24) File was processed with these loaders:

Module parse failed: Unexpected token (11:50) File was processed with these loaders:

Module parse failed: Unexpected token (132:114) File was processed with these loaders:

Module parse failed: Unexpected token (153:12) File was processed with these loaders:

Module parse failed: Unexpected token (16:19) File was processed with these loaders:

Module parse failed: Unexpected token (16:25) File was processed with these loaders:

Module parse failed: Unexpected token (193:84) File was processed with these loaders:

Module parse failed: Unexpected token (20:39) File was processed with these loaders:

Module parse failed: Unexpected token (21:48) File was processed with these loaders:

Module parse failed: Unexpected token (23:16) File was processed with these loaders:

Module parse failed: Unexpected token (24:50) File was processed with these loaders:

Module parse failed: Unexpected token (2:23) File was processed with these loaders:

Module parse failed: Unexpected token (31:58) File was processed with these loaders:

Module parse failed: Unexpected token (37:19) File was processed with these loaders:

Module parse failed: Unexpected token (37:31) File was processed with these loaders:

Module parse failed: Unexpected token (3:56) File was processed with these loaders:

Module parse failed: Unexpected token (40:42) File was processed with these loaders:

Module parse failed: Unexpected token (40:61) File was processed with these loaders:

Module parse failed: Unexpected token (55:25) File was processed with these loaders:

Module parse failed: Unexpected token (70:27) File was processed with these loaders:

Module parse failed: Unexpected token (76:24) File was processed with these loaders:

Module parse failed: Unexpected token (7:38) File was processed with these loaders:

Module parse failed: Unexpected token (97:14) File was processed with these loaders:

amolbotre769 commented 2 years ago

If you know any solution please let me know

harm-meijer commented 2 years ago

@amolbotre769 Can you try installing the dependencies with yarn install --frozen-lockfile? Vue has a tendency to break with minor updates in dependencies.

amolbotre769 commented 2 years ago

@harm-meijer yes I install but nothing works.

harm-meijer commented 2 years ago

@amolbotre769 You need to run the install with --frozen-lockfile using the original yarn.lock

amolbotre769 commented 2 years ago

@harm-meijer can you please tell me what is the command to run the install with --frozen-lockfile using the original yarn.lock

harm-meijer commented 2 years ago

@amolbotre769 You can try git checkout fc2f51e25ffa0c9ab05b5ec545ca1221342dc691 yarn.lock and then do yarn install --frozen-lockfile

amolbotre769 commented 2 years ago

@harm-meijer Thanks a lot. It works but data is not show in site. What can I do for this?

amolbotre769 commented 2 years ago

@harm-meijer I am not able to see the sub categories under main category list.

harm-meijer commented 2 years ago

@amolbotre769 You can try running localStorage.clear() in the browser console and refresh the page. If you connect to your own merchant center project then make sure it works with the standard setup first (no .env file) then when using your own merchant center make sure you set up the configuration for it.

harm-meijer commented 2 years ago

@amolbotre769

I am not able to see the sub categories under main category list.

There is no sub menu in the new version.

amolbotre769 commented 2 years ago

@amolbotre769

I am not able to see the sub categories under main category list.

There is no sub menu in the new version.

@harm-meijer Thanks for helping me to solve the issue